CJIT - C, Just In Time! (dyne.org) 22
Long-time Slashdot reader jaromil writes:
As a fun project, we hacked together a C interpreter (based on Tiny C Compiler) that compiles C code in-memory and runs it live.
CJIT today is a 2MB executable that can do a lot, including call functions from any installed library on Linux, Windows, and MacOSX.
Slashdot reader oliwer points out "they are also including a REPL, which could be interesting." And the CJIT web page promises there's "no EULA to sign, no IDE to install... 100% Free and open source!"
It also says the project was inspired by Terry Davis (TempleOS) and Fabrice Bellard (Tiny C Compiler).
CJIT today is a 2MB executable that can do a lot, including call functions from any installed library on Linux, Windows, and MacOSX.
Slashdot reader oliwer points out "they are also including a REPL, which could be interesting." And the CJIT web page promises there's "no EULA to sign, no IDE to install... 100% Free and open source!"
It also says the project was inspired by Terry Davis (TempleOS) and Fabrice Bellard (Tiny C Compiler).
My favourite (Score:4, Funny)
Re: (Score:3)
C interpreters aren't new.
I first used one back in the 1980s.
They don't work very well. C isn't designed to be an interpreted language.
Re: My favourite (Score:2)
It's compiled "in-memory." It is not "interpreted" per se.
Re: (Score:3)
It's compiled "in-memory." It is not "interpreted" per se.
The problem is that small changes, such as tweaking a header file, can have global effects.
So, incremental compilation doesn't work very well.
You can kinda sorta make it work most of the time but with lots of limitations.
Languages designed for interpretation, such as Python, or for incremental compilation, such as Java, don't have the same problems (although they have different problems).
Re: (Score:2)
But t's value-add is presumably interactive development because it is used like an interpreter. It's a modified interpreter with better performance, something of value to no one these days.
Re: My favourite (Score:1)
Re: (Score:3)
Many interpreted languages are compiled in memory. Python, for example, isn't executed line by line, but compiled for a virtual machine bytecode and that bytecode is executed.
But it's still considered an interpreted language because you just run the code directly even though there's an implicit compile and link step that happens when you run the code.
It's a very fine distinction these days
Re: (Score:3)
We often use the term 'compile' informally to refer to programs that translate programs to a machine code, but, strictly speaking, a compiler is a program that translates a program written in one language into another. An interpreted language that didn't use some intermediate representation would be very odd. The only one I could come up with off-hand was Lisp, but it seems silly to draw a distinction on that basis when all we could say is "we have compiled languages and an interpreted language called Lis
Re:My favourite (Score:4, Funny)
The hair on all the Java people's backs just went up and now they're hissing at you.
Re: (Score:2)
C is the worst language available, except for all others that have been tried.
Well, not quite. But essentially all programming languages suck. The right tool for the right task makes them suck a bit less and for many tasks, C is it.
Re:My favourite (Score:5, Informative)
all programming languages suck.
"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup
Re:My favourite (Score:5, Funny)
There are only 10 kinds of computer languages: those that write numbers in binary, those that don't, and those with off-by-one errors.
("there's two hard problems in computer science: we only have one joke and it's not funny." - Phillip Bowden [x.com])
Gimple c-terp anyone? (Score:1)
2MB? (Score:2)
Flappy Bird is bigger than that...
Anyway, great job! It's fun to see news about a good old-fashioned "we did it because we could" open-source nerd project.
Dr. Dobb's 1989 (Score:5, Informative)
Re: (Score:2)
Ah, good old Dr. Dobb's. I do miss that magazine!
Run/C from 1985 still works too. (Score:3)
Javascript? (Score:3)
Where is the Javascript version so it can run in the browser window?
Re: Javascript? (Score:3)
It's somewhere. I believe it's an emergent property of a sufficiently large number of GET requests to jquery.org.
Tiny C.. (Score:3)