News for hackers. Stuff that matters.
Re:Scala Native v0.1 by scotchmi_st on Tuesday March 14, 2017 @01:43PM (#13869706)
I would love for there to be a similarly thorough project with Clojure. It really bothers me there's no good native compiler. Apart from anything else, it means that Clojure lives and dies by the languages it compiles to, and while Java is used everywhere still, it probably isn't the thing the kids are learning these days. Besides, without going into any further rational arguments for why using the JVM (or another VM) isn't always great, something about it feels a bit icky to me. On an aesthetic level.
Re:Scala Native v0.1 by nakkaya on Tuesday March 14, 2017 @04:48PM (#13871328)
I maintain a project called Ferret [1], which compiles a subset of Clojure to C++11. No VM no dependencies you get a single cpp file that can be compiled to native code. Supports any platform with a C++11 compiler. (atmega, arm, x86 etc.)

[1] http://ferret-lang.org/

Re:Scala Native v0.1 by lemming on Thursday March 16, 2017 @06:22AM (#13883875)
Doesn't using the GPL for the stdlib also mean that all programs written in ferret must also be GPL?
Re:Scala Native v0.1 by saurik on Wednesday March 15, 2017 @01:06AM (#13873942)
Scala (and Java itself) are much easier to build native compilers for than Clojure, where numerous values are actually small dictionaries, nothing has a fixed type, and a large amount of the code is expanded from macros that are expecting to executing in the environment of deployment (not some special compilation stage). It is a language that essentially needs a heavy runtime to be remotely efficient (as anything super small is going to be rather equivalent to a barebones/naive JavaScript implementation), and it is unlikely that an attempt to build out a nice runtime for it is going to somehow be extremely better than the JVM (or a JavaScript engine, which might be even better in some ways).
Re:Scala Native v0.1 by emmelaich on Tuesday March 14, 2017 @05:03PM (#13871454)
Forgive my ignorance, but wouldn't one of the existing Schemes be a better or as good option?

I thought the benefit/raison d'etre to Clojure is the JVM ecosystem.

Re:Scala Native v0.1 by mateuszf on Wednesday March 15, 2017 @02:42AM (#13874246)
JVM is the benefit, but great immutable collections data structures and respective functions are also very very nice.
Re:Scala Native v0.1 by fulafel on Wednesday March 15, 2017 @04:38AM (#13874672)
IME the biggest thing is having the same, much-better-than-JS language on front and back end.
Re:Scala Native v0.1 by pjmlp on Tuesday March 14, 2017 @03:27PM (#13870676)
> isn't the thing the kids are learning these days

Yep, they learn Ruby and then they need to go JRuby when performance becomes relevant. :)

Re:Scala Native v0.1 by jwdunne on Tuesday March 14, 2017 @05:52PM (#13871801)
Or they tend to just Go. Interestingly, I've read a lot of Go users come from the Ruby and Python communities.
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @03:06AM (#13874341)
What is interesting is leaving the expressiveness behind of a language like Ruby or Python, for a bit of AOT compilation to native code.

I bet if something like RubyMotion wasn't a commercial product, the reality would be quite different.

Re:Scala Native v0.1 by alehander42 on Wednesday March 15, 2017 @03:59AM (#13874532)
Crystal and Nim can be good alternatives, no type system sucks anyway
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @04:10AM (#13874563)
I agree, but they lack the Google stamp, which is one reason for Go's adoption.
Re:Scala Native v0.1 by taway_1212 on Wednesday March 15, 2017 @05:17AM (#13874815)
As a Scala/Java dev, I'd be willing to explore Go not because it seems like a better language (I have no opinion), but because I'd hope there's less design pattern/enterprise-overengineering approach among devs. Even in Scala, which is super-flexible, people tend to structure code like they do in Java - everything is decomposed into tiny classes to the point of absurd. One of the reasons is that the mocking frameworks expect to mock classes, so every bit of functionality needs to be it's own separate class, just like in Java...
Re:Scala Native v0.1 by jwdunne on Wednesday March 15, 2017 @05:31AM (#13874889)
Funnily enough, I was reading a Scala program the other day and I noted how much it looked like a high-level dynamic Java programming. I think there was maybe 8 lines of typical functional programming code and the rest just looked like imperative code. It seems a waste to use Scala that way to me, but maybe I'm missing something?
Re:Scala Native v0.1 by lmm on Wednesday March 15, 2017 @06:39AM (#13875148)
Even if you're writing Java-like code you get a lighter syntax, fewer awkward special cases (primitives and arrays aren't as special, == does the right thing by default, try doesn't need braces and nor do function blocks, if is an expression), and some very useful code-saving constructs (case classes, pattern matching). It's not using Scala's full potential but it's still a good language for that space.
Re:Scala Native v0.1 by lmm on Wednesday March 15, 2017 @06:35AM (#13875139)
I view mocks as a code smell. If you have good interfaces and make a clear distinction between services and values you should never mock - stub your services, and use real values in tests.
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @05:27AM (#13874867)
If Go ever gets adopted by the enterprise for full stack applications, not only devops related stuff, expect enterprise architects to come up with GoEE.
Re:Scala Native v0.1 by geodel on Wednesday March 15, 2017 @07:42AM (#13875409)
SwiftEE looks far more probable as IBM has already jumped on Swift on server thing. The no-GUI and no-framework Go is not helping Java style solutions.
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @09:25AM (#13875886)
> The no-GUI and no-framework Go is not helping Java style solutions.

Just wait and it will come, it only needs a bit of enterprise architecture caretakers.

JEE might have its flaws, but it is way better than any C or C++ enterprise stack I have used before, definitely better than CORBA for example.

Re:Scala Native v0.1 by geodel on Wednesday March 15, 2017 @10:35AM (#13876355)
I have no problem with JavaEE and I have used it many times. Though JavaEE developers/architects like Java EE solutions generates 10-20 times scaffolding in meetings before getting to the point.
Re:Scala Native v0.1 by fleurdelotus on Wednesday March 15, 2017 @04:49AM (#13874698)
I've read a lot of Go users come from the Ruby and Python communities

Don't believe what you read, especially when it originates from a biased source.

When i want productivity, i use python.

When i want speed, i use c.

When i want both, i use both.

Re:Scala Native v0.1 by tejasmanohar on Wednesday March 15, 2017 @01:13PM (#13877795)
I'm more confident with static typing... also easier to refactor. Go's more productive for me after a cut-off. I still love using Python for quick scripts.
Re:Scala Native v0.1 by jwdunne on Wednesday March 15, 2017 @11:28AM (#13876747)
So it isn't the case many Go users come from the Ruby and Python communities?
Re:Scala Native v0.1 by tootie on Wednesday March 15, 2017 @09:03AM (#13875768)
It's the Never Java crowd who I just don't get. Java is almost always the most practical answer. And if you don't like Java, then use C#.
Re:Scala Native v0.1 by jaegerpicker on Wednesday March 15, 2017 @11:55AM (#13876973)
If you hate yourself sure, Java is one of the worst working environments for a tech stack I've ever worked in. I've worked in a ton of others.
Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @02:34PM (#13878564)
I am yet to use a development environment that matches Java and .NET in terms of tooling, including libraries, IDEs, GUI toolkits, profilers , application servers, integration with legacy systems, network monitoring of clustered applications,...
Re:Scala Native v0.1 by pryelluw on Tuesday March 14, 2017 @09:57PM (#13873191)
Im one of those. Anytime Python / Django doesnt cut it I use Go. Works very well.
Re:Scala Native v0.1 by jwdunne on Wednesday March 15, 2017 @03:03AM (#13874333)
Have you got a few examples where you had to replace the former for the latter? Really interesting.
Re:Scala Native v0.1 by pryelluw on Wednesday March 15, 2017 @08:11AM (#13875512)
Sure. Last one was a static asset server that had to perform or the users would notice a delay. Built one in Go in about a week and put it behind nginx on a vps. It was faster than required, stand alone, and used very little memory. Its still running to this day.
Re:Scala Native v0.1 by stykky on Wednesday March 15, 2017 @04:51AM (#13874705)
why Ruby's performances are low? I've tried ruby but sintatically makes my eyes sad. and i left
Re:Scala Native v0.1 by anoctopus on Tuesday March 14, 2017 @10:06PM (#13873225)
Java is still taught in plenty of places and is entrenched enough to stick around for the foreseeable future. The JVM would still be fine even if Java the language declined. Clojure is is a much less vulnerable position than most languages in terms of VM risk, with Clojurescript and ClojureCLR.

The real benefit of native Clojure to me would be for reducing startup time and the JVM overhead in containers. The best option for this right now is CLJS, but it would be nice to just not have a runtime.

Re:Scala Native v0.1 by pjmlp on Wednesday March 15, 2017 @03:52AM (#13874498)
You always need a runtime, even if it is a native compiled one.
Re:Scala Native v0.1 by keymone on Tuesday March 14, 2017 @04:10PM (#13871041)
one of Hickey's initial goals for Clojure was to be hosted language by design because <reasons>.

still i agree with you, having native clojure would be amazing. there is pixie which is transpiled by rpython into c++ but it's pretty much abandoned.

Re:Scala Native v0.1 by fulafel on Thursday March 16, 2017 @12:56AM (#13882631)
There's also https://github.com/pixie-lang/pixie - a Clojure flavoured Lisp on top of the PyPy JIT foundation.
Re:Scala Native v0.1 by davidlin on Thursday March 16, 2017 @02:50AM (#13883068)
There's [cljs + react native](http://cljsrn.org/) which isn't a native compiler, but does compile to native code.
Re:Scala Native v0.1 by whazor on Wednesday March 15, 2017 @02:57AM (#13874307)
The kids are learning javascript, as it runs everywhere. Plus there's a clojurescript, so you should be safe. Furthermore, I wouldn't be scared on Java dying.