Live data from Hacker News

Fennel: A Practical Lisp

mattroelle.com

51–60 of 91 posts

Re: Fennel: A Practical Lisp

#52

What might be a good toy project to try with this? I've had a vague interest in lisp for a while, and fennel seems like a good entry point, I just need some direction on a small project that would be a good fit for the language.

IRC bot! You just need to pull in a lua sockets library to get going.

Re: Fennel: A Practical Lisp

#53

What might be a good toy project to try with this? I've had a vague interest in lisp for a while, and fennel seems like a good entry point, I just need some direction on a small project that would be a good fit for the language.

The cookbook[0] has some good examples, I went with the state machine parser as a base for highlighting in mpv's console (mpv scripting has been the main focus of my fennel use, mostly rewriting existing code)

[0] https://github.com/bakpakin/Fennel/wiki/Cookbook

Re: Fennel: A Practical Lisp

#54

I tried Moonscript (another lang that compiles to Lua). Unlike JS, it didn't seem like the Lua VM supported source-mapping, so if there was a runtime error in my code, it appeared as a gibberish Lua error and not a MoonScript error. Is the same true for Fennel?

Not sure exactly what you're looking for but it at least seems to do a good job of telling me the line in my .fnl file that has the error (though it also says "in function ?" despite being in a named function). Also, that's running through the Fennel interpreter rather than transpiling to Lua and then running it with Lua.

Re: Fennel: A Practical Lisp

#55
post #42
post #41

Earlier quoted context omitted.

That's a very good point. To add: stability and simplicity are choices. Compare Lua to JS for example which started out similarly but Lua was kept simple and stable, while JS introduced massive churn and tooling complexity, much of it being unnecessary in my eyes. I don't use Lua anymore but it has a special place in my heart. I started learning it to use Love2d and then got my first job as a developer out of sheer l…

> Compare Lua to JS for example which started out similarly but Lua was kept simple and stable, while JS introduced massive churn and tooling complexity, much of it being unnecessary in my eyes. Anything you wrote in JS twenty years ago probably still works. Tooling has changed, but none of that's an official part of the JS language. The language has only some added features that you can opt to not use. If you're com…

For a solo developer, you can opt not to use any of the new features of JS.

But if you are working in industry and do some front-end programming… You are going to work with the features that other people around you have decided makes their life easier.

It is possible to work with like-minded souls that want to keep JS simple, but it certainly isn’t a given.

Re: Fennel: A Practical Lisp

#56
Lisps are great because of their radical simplicity which saves you a ton time learning syntax.

You're going to need that time to invest in switching to Emacs.

Re: Fennel: A Practical Lisp

#57
Side question for all of you who are saying “the Lua language is very stable”: do you mean you're staying on Lua 5.1/5.2? If so, is this driven by LuaJIT essentially freezing everything in place by grabbing so many users and libraries off the PUC-Rio implementation? If not, what counts as stable to you? Lua 5.3 and 5.4 both have dialect incompatibilities with prior versions.

Re: Fennel: A Practical Lisp

#58

Side question for all of you who are saying “the Lua language is very stable”: do you mean you're staying on Lua 5.1/5.2? If so, is this driven by LuaJIT essentially freezing everything in place by grabbing so many users and libraries off the PUC-Rio implementation? If not, what counts as stable to you? Lua 5.3 and 5.4 both have dialect incompatibilities with prior versions.

I consider Lua 5.1/5.3/5.4 to be roughly their own language. Somewhat akin to a Python2 vs Python3. Completely manageable transition if you want, but best to stick to an implementation if you can. Within a platform, there are seemingly only ever bug fixes.

NeoVim[0] had a few words on this topic.

0: https://github.com/neovim/neovim/wiki/FAQ#why-lua-51-instead...

Re: Fennel: A Practical Lisp

#60
post #54

I tried Moonscript (another lang that compiles to Lua). Unlike JS, it didn't seem like the Lua VM supported source-mapping, so if there was a runtime error in my code, it appeared as a gibberish Lua error and not a MoonScript error. Is the same true for Fennel?

Not sure exactly what you're looking for but it at least seems to do a good job of telling me the line in my .fnl file that has the error (though it also says "in function ?" despite being in a named function). Also, that's running through the Fennel interpreter rather than transpiling to Lua and then running it with Lua.

Fortunately the generated Lua code is pretty readable. I can't speak for a large project, but I'm usually able to find bugs by inspecting the generated Lua code, and I'm usually able to find and fix them in the Fennel source without difficulty.
Post reply on HN