News for hackers. Stuff that matters.
Re:Java on Truffle – Going Fully Metacircular by grashalm on Wednesday January 20, 2021 @06:39AM (#25845202)
GraalVM dev here. Note that Java on Truffle is fully Open Source and available on Github.

If you can read Java code and you are interested in how it is implemented start reading here: https://github.com/oracle/graal/blob/espresso/espresso/src/c...

If you are interested in a deep dive into the Truffle technology and are interested in why it makes sense to implement a language on top ofTruffle checkout my recent Rebase talk for a really long answer: https://youtu.be/O4icaN9khp4

If you don't have enough time for an 1h talk checkout my summary tweet: https://twitter.com/grashalm_/status/1212763944043139072

Re:Java on Truffle – Going Fully Metacircular by jarym on Wednesday January 20, 2021 @07:10AM (#25845469)
Hey, I absolutely love Graal and where it is going. Big problem for me has been the license: GPLv2+CPE. On its own this is not a problem but coming from Oracle it makes people nervous.

I think if there's ever room to move towards Apache 2 or similar license it would be really welcome.

Re:Java on Truffle – Going Fully Metacircular by pwdisswordfish5 on Wednesday January 20, 2021 @08:52AM (#25846415)
There's no reason to think that you're safe even if it were Apache-licensed. One of the things that was made clear in Oracle v. Google is that Oracle effectively treats litigation as an essential expense for exploring all revenue sources, leaving others susceptible to suits whether they have merit or not. Compounding this latter concern was that another thing made clear is that the terms of the respective licenses is something that Oracle doesn't consider important. Refer to McNealy testifying for example that commercial use of even GPL-licensed work is prohibited (despite the terms of the license not supporting this stance).
Re:Java on Truffle – Going Fully Metacircular by kaba0 on Wednesday January 20, 2021 @10:33AM (#25847574)
And there is no reason the spread FUD.

Oracle v. Google has nothing to do with it (Java’s licence at the time explicitly disallowed mobile usage) Do you have an examples that give rise to any sort of concern about the usage of GPL-licenced code (regardless of code owner)?

Re:Java on Truffle – Going Fully Metacircular by pwdisswordfish5 on Wednesday January 20, 2021 @12:15PM (#25848980)
It's like we're not even having the same conversation. McNealy, founder of Sun, testified under oath that GPL doesn't permit commercial use. What was unclear about this the first time it was stated?
Re:Java on Truffle – Going Fully Metacircular by sideeffffect on Wednesday January 20, 2021 @05:23PM (#25852762)
> GPL doesn't permit commercial use

That is alarmingly false. Do you have a source that McNealy indeed has said that? I couldn't find anything by googling.

Re:Java on Truffle – Going Fully Metacircular by pwdisswordfish5 on Wednesday January 20, 2021 @07:06PM (#25853603)
Scott McNealy, under direct examination on 2012 April 26: "you can't license GPL code and then resell it for a profit"

Source: Official Reporters for the US District Court for the Northern District of California (regarding Oracle v. Google, 3:10-cv-03561)

Re:Java on Truffle – Going Fully Metacircular by exabrial on Wednesday January 20, 2021 @08:23AM (#25846092)
Question for you, but first I just want to say thanks! The technology is awesome.

That Tetris game is that a command line thing? If so what library are you using to manipulate the console? I've wanted to create interactive command line utilities with the JVM for a long time and it's always been not supported.

Re:Java on Truffle – Going Fully Metacircular by mukel on Wednesday January 20, 2021 @08:50AM (#25846389)
Re:Java on Truffle – Going Fully Metacircular by exabrial on Wednesday January 20, 2021 @08:57AM (#25846470)
Ok what on earth is going on there... It's launching a shell but I'm not sure what the stty does
Re:Java on Truffle – Going Fully Metacircular by shakna on Wednesday January 20, 2021 @09:34AM (#25846858)
The commandline buffers input by default, because it starts in "cooked" mode.

That line turns off buffering so that keypresses can immediately be read, by putting it into "raw" mode.

Re:Java on Truffle – Going Fully Metacircular by exabrial on Wednesday January 20, 2021 @10:49AM (#25847814)
excellent! thank you
Re:Java on Truffle – Going Fully Metacircular by shelajev on Wednesday January 20, 2021 @08:33AM (#25846208)
that's this tetris: https://github.com/kt97679/tetris/blob/master/Tetris.java

ncurses I think. There's an issue with how jconsole and tetris work together, so when tetris exits, jshell does too.

Re:Java on Truffle – Going Fully Metacircular by grashalm on Wednesday January 20, 2021 @06:50AM (#25845298)
Also join us on Slack if you have questions: https://www.graalvm.org/slack-invitation/
Re:Java on Truffle – Going Fully Metacircular by jgalt212 on Wednesday January 20, 2021 @09:52AM (#25847071)
> A new compiler or GC optimisation often requires years of work. With GraalVM that work does not need to be replicated for every language.

Isn't this only true for GCC code that operates above the GENERIC form level?

Re:Java on Truffle – Going Fully Metacircular by moonchild on Friday January 22, 2021 @01:39AM (#25869066)
Not sure what you're saying here.

The ‘GC’ refers to garbage collector, not GCC.

It is true that you can write a compiler frontend targeting a generic backend (like GCC), and take advantage of existing optimizations. Truffle's somewhat unique value prop is that you can write a basic interpreter (not compiler) and get performance approaching that of a top-end JIT.

Re:Java on Truffle – Going Fully Metacircular by yarg on Wednesday January 20, 2021 @06:33PM (#25853332)
Any chance of a wasm and/or llvm backends?
Re:Java on Truffle – Going Fully Metacircular by logicchains on Wednesday January 20, 2021 @07:22AM (#25845568)
A question: how does a company allegedly so lawyer-first, tech-second manage to develop such cutting edge software? Oracle isn't normally a name that comes to mind when people think of programming language research.
Re:Java on Truffle – Going Fully Metacircular by chrisseaton on Wednesday January 20, 2021 @07:45AM (#25845759)
> Oracle isn't normally a name that comes to mind when people think of programming language research.

Oracle has a very large, well-funded, and long-term PL research lab that consistently produces top-tier papers, and funds and collaborates with many academics.

If it doesn't come to mind when thinking about PL research then I can't think you're reading much PL research.

Re:Java on Truffle – Going Fully Metacircular by grashalm on Wednesday January 20, 2021 @07:33AM (#25845673)
GraalVM was born in Oracle Labs, the spiritual successor of Sun Labs. There are many great innovations coming from Oracle Labs: https://labs.oracle.com/pls/apex/f?p=94065:INTRO::::::
Re:Java on Truffle – Going Fully Metacircular by ksec on Wednesday January 20, 2021 @09:42AM (#25846958)
>so lawyer-first, tech-second manage to develop such cutting edge software?

Most DBA I met would not argue against Oracle having the best Database. Whether they would choose to use it for their projects is entirely different though. Something that is objectively good has zero to do with whether you like or dislike the company.

The amount of work that is going into JVM and VM research is absolutely insane. One VM to Rule them All, [1], that was submitted to HN in 2013.

[1] https://news.ycombinator.com/item?id=6232240