Hacker News new | ask | show | jobs
by Imustaskforhelp 269 days ago
> The road to hell is not paved with good intentions but rather the lack of intention.

Although I am a man who seemingly seems to love the idea of a freedom of a language like nim,julia,lisp,(scala?) etc., just langauges which can give you a lot of freedom in general, my intention has always been: I have been asking for freedom irl, what is wrong with giving developers freedom in programming languages.

I can still respect this opinion and I followed up on pragmatic choice and I mean, its Mr's Wilson's language and honestly the freedom to have a language like this might be freedom in it of itself too and I can respect his opinions and I might check odin again later too.

https://skytrias.itch.io/todool I saw it from Odin lang page a long time back ago and I actually really loved this tool/ am thinking of creating an open source alternative in an another language like golang/kotlin/typescript/nim (i like to imagine things and be lazy sometimes lol) but there are definitely a lot of projects like jangafx which are written in odin iirc which are definitely really impressive

I will also think about this statement more as I do think that the reason why I sometimes lack intention is because I want to define good first, I don't want to take my opinions and run with it if they hurt people directly or indirectly and I am willing to have lack of opinions first to really understand the situation I suppose but I can respect his opinion in this thing too. Something worth thinking about for me. So thanks!

1 comments

All of those languages have a lot of freedom, you just ("just") need to reach into the FFI to do it. Lua, which is the only one I have used extensively, is the most literal definition of scripting. It's designed to be written in conjunction with C. Even languages like Haskell with a gigantic runtime still expect you to put in some C for hot paths.
FFI scares me if I am being honest and that is why I always try to think of a language which can do a lot of things themselves without having to reach for FFI thinking its going to be my last resort most of the time.

So that was my perspective when I had written up my comment.

What are some really good languages for FFI? Lua as you suggest?

I have always had this notion that FFI is really hard and so firstly I would like to ask if that's really true and secondly is there a langauge which can make it easy to work with FFI the most? Like do you suggest lua for something?

PUC Lua is supposedly a bit of a pain for ffi, but I havent tried it myself. Luajit is some kind of crazy magic. You can (almost) just copy and paste the c header file into the ffi.cdef function and then start using c functions as if they were lua functions.
The LuaJIT ffi module has been ported to PUC Lua [0] (and abandoned and forked dozens of times), and it works pretty well in my experience.

[0]: https://github.com/dibyendumajumdar/ravi-ffi

FFI is harder if the target lib doesn't have a C interface.

I feel I'm forced to reach for FFI if I want to do anything graphical e.g Wayland or OpenGL. Otherwise it's optional