Earlier quoted context omitted.
That's exactly how Truffle's cross-language-interface works though. Instead of paying the high cost of conversion, data stays in its existing representation and it is the interface code that is recompiled to fit. An example is JRuby+Truffle where in its C extensions, pointers to Ruby objects act to the C code as if they are pointers to MRI data structures, but behind the scenes Graal compiles code that accesses them…
Interesting. What happens if the native memory layout doesn't support a feature that the extension code requires? For example, what if a JRuby+Truffle script calls into a C library, which allocates a struct and invokes a Ruby callback with it, which then wants to access the fields via reflection? C doesn't normally include type information with its structs, so how would the Ruby code know the memory layout of the obj…
Graal and Truffle could accelerate programming language design
141–150 of 204 posts
Re: Graal and Truffle could accelerate programming language design
#142Earlier quoted context omitted.
Well there are these sources from Microsoft: https://blogs.windows.com/buildingapps/2014/05/15/real-time-... https://rtaudiowsapps.codeplex.com/ https://channel9.msdn.com/Events/Build/2014/3-548 And I just found this, but not sure how good it fares. https://www.microsoft.com/en-us/store/apps/audio-meter/9wzdn...
You linked to an app that measures audio db levels. There are no low latency audio / music apps because windows phone isn't very good at it.
Sometimes being good at something isn't enough.
Re: Graal and Truffle could accelerate programming language design
#143Earlier quoted context omitted.
if the industry were really striving for perfection, there would be no COBOL or BASIC, for instance. COBOL was a huge improvement at the time, an innovation in readability. BASIC is a good demonstration of why the platonic ideal language is wrong: it was designed for beginners (that's what the acronym stands for), and it did a reasonably good job at that. Beginners might be overwhelmed by OOP, multiple dispatch and a…
> COBOL was a huge improvement at the time, an innovation in readability. BASIC is a good demonstration of why the platonic ideal language is wrong: it was designed for beginners (that's what the acronym stands for), and it did a reasonably good job at that. Sure. But these systems were created from the ground up, every single time. Given a good foundation, which could be Lisp or something even better, you can whip u…
Times have changed now? Sure, but history didn't wait.
Re: Graal and Truffle could accelerate programming language design
#144Earlier quoted context omitted.
Don't know why you get downvoted. That's exactly what I thought. Java is my main lang and currently I'm working on my hobby project - implementing Scheme r5rs in Java. That is hard! And I doubt I'll be able to implement full r5rs even close. I have no idea (yet) how to implement Continuations: In theory yes, you can implement Continuations in any lang which has Exceptions (the only way in Java to unwind a stack). Lik…
You're not compiling to Java though. You're writing an AST walking interpreter, so you should be able to implement continuations and TCO just fine.
Are you still using Java stack, Java calling convention, still able to do Java interop?
When you are writing your own language on top of Java (Scheme, for example), you have full control of your lang AST (S-expressions, for example). How does it help to implement TCO and continuations (assuming you don't want to lose Java interop, Java calling convention, Java stack and performance)?
Re: Graal and Truffle could accelerate programming language design
#145Earlier quoted context omitted.
You linked to an app that measures audio db levels. There are no low latency audio / music apps because windows phone isn't very good at it.
Or maybe because no one capable of writing such applications wants to target 1% market share? Sometimes being good at something isn't enough.
Re: Graal and Truffle could accelerate programming language design
#146So why is Oracle doing this? Also, anything from Oracle which is partly open and partly closed is scary. They've done that with Java and MySQL, which drives people away from both.
Re: Graal and Truffle could accelerate programming language design
#147Doesn't RPython do all the same things? Also there are language workbenches ( http://www.languageworkbenches.net/ ) that allow one to get a bunch of things like IDE support and even basic compilers by properly expressing the language syntax and semantics. I agree there is a lot of interesting stuff going on here but lets not forget the prior art. Even OMeta I think already did a lot of these things way back when. Goi…
Re: Graal and Truffle could accelerate programming language design
#148Interesting that they've gone as far as running C extensions "internally", making it easier to run existing ruby apps without running up against the barrier of a native gem and having to change the code.
Re: Graal and Truffle could accelerate programming language design
#149Earlier quoted context omitted.
Yes, you could. You'd implement a program to take C code and emit an equivalent Lisp program (i.e., parse C and emit the tree into Lisp), then compile the Lisp program. The annotations and care the parser/semantic analysis code uses will provide the semantics of C. This will, however, not "play" like C without a great deal of work. You will be dragging an entire Lisp VM around and have to shake all of that out to act…
Why compile to lisp in the first place? Build a nanopass framework ( https://www.google.com/url?sa=t&source=web&rct=j&url=http://... ) that acts on sexprs, and then emit the thing to a target of your choice. The advantage is that Lisp is really good at transforming sexprs, and macros make writing the infrastructure for that sort of compiler just that much easier.