embedded-language

How to embed LLVM?

南笙酒味 提交于 2019-12-03 23:37:05
The LLVM Core project consists of: Compiler - converts source code to LLVM IR VM - executes compiled IR code How can I embed the VM to a C++ application? Take a look at the HowToUseJIT example in LLVM. The LLVM is really a collection of libraries that you can link to, so it's pretty easy to embed. More often the LLVM takes IR that you generate and compiles it directly to machine code. There is also a library available to interpret and execute IR for platforms that do not support JIT compilation. There's a pretty good tutorial available on the LLVM website here: http://llvm.org/docs/tutorial/ .

Small RISC emulator

为君一笑 提交于 2019-12-03 20:26:29
I'm looking to build a VM into a game and was wondering if anyone knew of any really simple VM's (I was thinking RISC/PIC was close to what I wanted) that are usually used for embedded projects such as controlling robots, motors, sensors, etc. My main concern is having to write a compiler/assembler if I roll my own. I'd be nice to use the tools that are already out there or in its simplest form just a C compiler that can compile for it :-p. I really don't want to re-invent the wheel here but I also need thousands of these running around a virtual world so they have to be as simple and as fast

Is it possible to load and execute C# snippets using DLR?

眉间皱痕 提交于 2019-12-03 07:03:43
The majority of material I have found regarding DLR is related to IronPython. Can you parse and execute C# using DLR? If so is there over head that would prevent you from attempting this on a web server with about 30 users? More specifically I would like to script the configuration of my workflow objects when a user first initiates a workflow. Depending on conditions that change through out the year workflows may start at different steps, hence running configuration scripts seems like a good way to handle the variation. It sounds like you're really talking about the C# "compiler as a service"

Embedded language: Lua vs Common Lisp (ECL)

大兔子大兔子 提交于 2019-12-03 04:17:02
问题 Does anybody here have a experience with Common Lisp as a embedded language (using ECL)? If so, how good is ECL compared to Lua? 回答1: I haven't embedded CL before, but I've done it with both Lua and two particular Scheme implementations (Gambit-C and GNU Guile). Scheme makes a great embedded language in my opinion, because it is flexible and not too bloated. Gambit-C is particularly awesome for this because it allows you to both run interpreted scripts, and also compile your code down to C.

Why do we need an embeddable programming language like Lua?

帅比萌擦擦* 提交于 2019-12-03 03:17:34
问题 What are the typical use cases of using an embeddable programming language? Do I understand it correctly that such language should be embedded into some program environment and should be able to be executed from there? 回答1: Since you tagged the question as "Lua", I'll give you an answer in the context of this language. Introduction Lua is written in C (almost completely compatible with C89 standard; the incompatible features can be easily disabled, if needed, using compile-time switches) and

Why do we need an embeddable programming language like Lua?

只愿长相守 提交于 2019-12-02 16:49:01
What are the typical use cases of using an embeddable programming language? Do I understand it correctly that such language should be embedded into some program environment and should be able to be executed from there? Since you tagged the question as "Lua", I'll give you an answer in the context of this language. Introduction Lua is written in C (almost completely compatible with C89 standard; the incompatible features can be easily disabled, if needed, using compile-time switches) and has been designed to be easily integrated with C code. In the the context of Lua, "integrated" means two

Embedded Lua “print” not working in debug mode from Visual Studio

我们两清 提交于 2019-12-01 08:43:25
I am using Luainterface 2.0.3 to embed Lua in a c# application. Everything is working fine, except in visual Studio's debug mode, the Lua's print function does not get written to the console (nor to Output). using System; using LuaInterface; namespace Lua1 { class Program { static void Main(string[] args) { Lua lua = new Lua(); lua.DoString("print 'Hello from Lua!'"); } } } Running it in non debugging mode, print is working fine. Am I missing something? Thanks! Unfortunately, you are probably up against a known deficiency in the print() function, which is really intended for quick and dirty

python object to native c++ pointer

人走茶凉 提交于 2019-12-01 00:43:09
Im toying around with the idea to use python as an embedded scripting language for a project im working on and have got most things working. However i cant seem to be able to convert a python extended object back into a native c++ pointer. So this is my class: class CGEGameModeBase { public: virtual void FunctionCall()=0; virtual const char* StringReturn()=0; }; class CGEPYGameMode : public CGEGameModeBase, public boost::python::wrapper<CGEPYGameMode> { public: virtual void FunctionCall() { if (override f = this->get_override("FunctionCall")) f(); } virtual const char* StringReturn() { if

How to call R from within a web server (like Apache)?

我怕爱的太早我们不能终老 提交于 2019-11-29 06:40:30
That is, is there an embedded R interpreter available? You could use Jeff Horner's excellent rapache . Other options that are CGI-alike are mentioned in the section 4 of the R FAQ which discusses Web interfaces . You can used Shiny app into R http://shiny.rstudio.com/tutorial/ 来源: https://stackoverflow.com/questions/1395174/how-to-call-r-from-within-a-web-server-like-apache

How to embed Ruby in C++?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 07:32:28
What's the best way to embed Ruby as a scripting language in C++? Using ruby.h? SWIG? Something else? What I need is to expose some C++ objects to Ruby and have the Ruby interpreter evaluate scripts that access these objects. I don't care about extending Ruby or accessing it in C++. I've found this article on embedding Ruby in C++ , and while it's very useful, it's kinda old and I was wondering if there are any other resources on the subject (or open source implementations of similar engines). swig is probablly the way to go..... but ruby doesnt embed too well...... if you want a language that