In C/C++, you have to compile source code into executable, then run it. Or in Python, you write source code then an interpreter will execute that for you.
Is there a word for such programming environment?
Related
I want to have tclsh binary in my root file system generated by Buildroot.
In buildroot, we can (from menuconfig) go to Interpreter languages and scripting -> then choose tcl
But this will install tcl8.6 packages (opt0.4, http1.0). The tcl shell itself is not implemented in the generated file system.
Does anyone know how to enable tclsh in Buildroot
Thanks in Advance
You will have to tell buildroot not to remove tclsh from your build. This can be achieved by setting BR2_PACKAGE_TCL_SHLIB_ONLY=n after having run make menuconfig.
See also https://git.busybox.net/buildroot/tree/package/tcl/tcl.mk#n51.
I would like to use Xcode under Mac OS X to compile and run a program written in a language that is not supported, e.g. Fortran. Assuming I have a compiler installed, e.g. gfortran or ifort, what are the steps in the Xcode project settings to make it possible to compile and run the program?
I have created an new, empty project since Fortran is not supported (only C,C++,Objective-C and Swift are selectable in a command line tool application). I created a simple Fortran file. But now I guess I have to add several things to the Builds tab in the project settings to make it compile and run (it works from the command line). What are these steps?
Add an external build system target to your project. External build system targets/projects let you build projects in languages Xcode doesn't natively support. The external build system target/project is in the Other section under OS X on the left side of the assistant. When you click the Next button, you'll be asked for the location of the build tool. Enter the path to your Fortran compiler. When you build the project, Xcode will use the Fortran compiler to do the building.
How can I make sublime compile and run my c/c++ code and open the output program in a new terminal window like what happens when I use an ide such as code blocks?
Glue plugin can do what you want.Check it out:
http://gluedocs.readthedocs.org/en/latest/
I have a blog built with Ruby, but I frequently blog about Objective-C topics.
I thus need a Ruby library that can take Objective-C source code strings and produce syntax-highlighted HTML output.
For Ruby source strings, I am happily using the syntax gem - http://syntax.rubyforge.org/ - but I can't find an Objective-C tokenizer for this library.
Is there an open source tokenizer available, or another library which can do this in Ruby?
If all else fails, all I've found is a PHP library (GeSHi) which claims to have Obj-C support, and I'll have to install PHP on my host, write a janky shell exec based invocation of it. I would love to avoid this. Thanks!
Well, you can just use a command line tool to do this and the best possible solution is surely Pygments, and if you're running on a Linux hosting you probably have Python installed already.
Just call it from the command line and store the output somewhere.
A little digging on Google led me to this gem, Highlight, which supports Objective-C. There are a few other Ruby gems listed here.
I'm new to Lua and work around with some tutorials, try some basic stuff like coding common algorithms etc.
But I have some trouble while using the lua interpreter on my mac os machine.
For example let's say we have a file called 'sample.lua', holds the code line:
function fib(n) return n<2 and n or fib(n-1)+fib(n-2) end
How do I run that function from terminal?
If I don't use any function, I just call the script with 'lua script.lua' - works!
Next question points on the basic understanding between the usage of non-compiled and compiled lua-source. Why is lua code run without compiling, like I mentioned before (lua script.lua)? Or will this statement compile the code temporarily and run afterwards?
Thanks in advance
chris
You can run lua from the terminal with the -i flag:
lua -i luascript.lua
This will execute the script and then put the interpreter into interactive mode. Then you could call the function right from the interactive prompt:
fib(3)
To run that function from the terminal, you would have to do something like:
lua -e"dofile'sample.lua' print(fib(3))"
The -e there just tells it to execute the following string, which loads your file 'sample.lua' and then prints the result of fib(3) to stdout.
I don't know the answer to your second question though.
Lua scripts are always compiled into Lua VM instructions before running. Precompiled scripts just skip this step.