Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> spent long, hard hours banging my head against native-image and it just wasn't working out.

it would be nice to know what exactly isn't working out and what the problems with native-image was.

Coz i think clojure is as close to perfect, imho, as a language can go without selling out.



Graalvm native image for Clojure is a solved problem. Just add this library to the project and add a flag to native image command line.

https://github.com/clj-easy/graal-build-time

This initializes Clojure classes at build time and it mostly works for pure Clojure code.

Doing complicated things (e.g. depending on native library, etc.) requires some tweaking. For example, a few packages may need to be declared as initialized at build time or run time, depending what they are doing. And any unresolved classes need to be added to reflection-config.json.

All these are easily discoverable if one talks to people in the Clojurian slack channels. Clojure is a small community, so it helps to be part of it, because there are not a lot of open materials on the Web.


> solved problem

except...

> mostly works

> requires some tweaking

> discoverable if...

I know nothing about Clojure but from your caveats I think I can see why he spent hours banging his head against a wall.


when engineers say it's a solved problem, they mean it in the same way as a mathematician saying a theorem is trivially proved.


> theorem is trivially proved

Reminded me Prof. Knuth trolling in "The Art Of Computer Programming" with an exercise for the reader to prove Fermat's Last Theorem. (:


Look at the hoops OP had to jump through to get SBCL working on Windows. I think Graal would compared favourably with that.


Probably, but that doesn't mean Graal is good; it just means they're both bad.

Compare it to something like Go or Rust where there are no hoops and they're both well supported on Windows and Mac. I haven't actually used it but I believe Zig has very good cross platform support too.


if I recall correctly Rust support for windows still has issues, namely there are a number of Windows specific APIs that are either not well supported or aren’t supported at all.

I could be mistaken or recalling outdated information of course, but that is what I remember from the last time I looked into it


What did you mean? Can't the user just download Portacle and use it?

https://portacle.github.io/

Problem solved.


Right at the top of the article, the author outlines the requirement was that it must be usable within vim.


Not an issue for Common Lisp, you can use whatever you like, but interacting with a REPL gives you superpowers.


Not really. OP needs to build executables. It is documented here: https://blog.djhaskin.com/blog/release-common-lisp-on-your-f...


Portacle ships SBCL so one can build executables when using Portacle.


I actually just dusted off my old Clojure stuff to see if it was a "solved problem", and it isn't.

I grant that it might be described thus if I started out with that stack, but trying to retrofit an older code base with it is, I have found, next to impossible. You have to code around the myriad gotchas as you go or you're never going to identify all those landmines going back over it after the fact. The errors and bad behaviors are too difficult to identify, even for the `native-image` tooling.


No. I have looked at your code. You did not use the mentioned https://github.com/clj-easy/graal-build-time

If you don't do what everybody is doing to solve a problem, then of course it is not a "solved problem" for you.

No, you don't need to code specifically for native-image. What are the landmines that you need to code around? Since you have not successfully compiled native-image by following common practices, you obviously don't know.


Why do you imagine the OP would push a failed experiment to a publicly available spot? They probably left it sitting in a local branch and went on with their day.


what are you referring to when you say a language can sell out?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: