Live data from Hacker News

Why Fennel?

fennel-lang.org

121–130 of 174 posts

Re: Why Fennel?

#121
post #45

I do not understand the appeal of LISPy languages. I get that the parser is simple and elegant, but I believe the developer (of the compiler in this case) should serve the convenience of the user, not the other way around. Writing code like this is cumbersome and unnecessarily symbol heavy, and reading it isn't really nice as well. I'd rather have the language add that extra complexity into the parser than have me st…

I do not understand the appeal of non-LISPy languages. I get that most people are used to reading it and that they are efficent, but I believe the developer (of the compiler in this case) should serve the convenience of the user, not the other way around. Writing code like this is combersome and unnecessarily symbol heavy, and reading it isn't really nice as well. I'd rather have the language add those extra parens i…

My understanding is that Lisp and most functional languages map very well to PL theory and how compilers and interpreters manipulate programming languages (functions as graphs of code, types as contracts etc.), while procedural languages map well to how CPUs execute programs, and the abstractions operating systems provide (functions as mappable pieces of memory, types as memory or register layouts etc. )

Re: Why Fennel?

#122
post #98

Earlier quoted context omitted.

It is only function calling that needs (,); in C and () in Lisp. Which is half as many characters, but much much much noisy since: - it is used everywhere - carries very little information Look at the example on the Janet page transcribed to Python syntax [0]. Several differences: - in Janet nearly every line starts and ends with ( and ), which is just noise - in Janet there are several )))) - in Janet there is no sp…

Ok, let's compare looping for (int i = 0; i vs (loop for i from 0 below 5 do (format t "~A~%" i)) C has the same number of parentheses and also has curly brackets. C additionally has a bunch of semicolons and a comma not present in the Lisp version. The C version is also omitting the required function encapsulation to actually run this, while the Lisp version can be run as a top level expression. The comparison reall…

> The comparison really isn't even close.

IMO it's close. Lisp isn't much worse than other languages. Tho it needs special syntax for some common constructs. It helps the human.

Regarding the for loop, if you only loop one statement, you do

    for (int i = 0; i 
If you loop several statements, you do

  (loop for i from 0 below 5
        do (progn
           (format t "~A~%" i)
           (format t "~A~%" i)))
again, lisp lacks the syntax to group several statements together. In C it ends with );} , indicating a function call inside a control flow or a block. In lisp ))) can be anything from function definition to assigning variables or arrays/collections or anything.

Re: Why Fennel?

#123

Earlier quoted context omitted.

I have about 140 Emacs plugins running. I've never had to declare Emacs bankruptcy. 10 years of good times with Emacs+evil and 35 years of vim. Fwiw.

Sadly that's not worth anything. ¯\_(ツ)_/¯ Anecdotal evidence in both directions. I had a soft spot for Emacs for a _long_ time (almost two decades)... FWIW. ;) Key word: had.

Now you're living life large with jetbrains and making the big bucks !

Re: Why Fennel?

#124

Earlier quoted context omitted.

Sadly that's not worth anything. ¯\_(ツ)_/¯ Anecdotal evidence in both directions. I had a soft spot for Emacs for a _long_ time (almost two decades)... FWIW. ;) Key word: had.

Now you're living life large with jetbrains and making the big bucks !

Nope. Neovim. And even there some of the "distros" got on my nerves. I guess at one point I'll just learn Neovim's API and make my own blend like everyone else.

NOT looking forward to it. But I suppose there's no other way.

I still view Neovim as a huge improvement over Emacs though.

Re: Why Fennel?

#125
Apart from Forth, Lisp and Lua, Tcl also deserves mention as a small embeddable language. Not sure of its state today; I think by v8 it had started to get more complex, but its original incarnation was very simple. I remember getting Ousterhout’s book and being so enamored with the elegant design that I felt compelled to just implement it myself from scratch, which took just two days.

Re: Why Fennel?

#126

https://janet-lang.org Also by the same author.

>by the same author What? People are just creating new languages these days as if they were Javascript libraries? Let's say I wanted to make my own programming language. What's the easiest way to prototype it in a way I can share it with the world? Are the programming language development toolkits that come with a tokenizer library and things like that? Should I write my own program to output machine code? Or maybe i…

I thought almost all programmers created a language or two in the course of their careers or hobbies.

You can make a simple language very easily if you design the syntax carefully and restrict its capabilities. It all depends on what you need it for.

In my case I needed a way to create reports from a Turbo Pascal program (TP3 for DOS I think) without having to edit the program and ship a new version. So I made a simple report generating language. It had simple for loops, all variables were global, tokens were all separated by white-space, no user defined sub-routines or functions, a set of predefined procedures specifically designed for the report generating function, arithmetic expressions that were only allowed in assignment statements, interpreted not compiled.

It was actually quite easy to do but of course was not a general purpose language. These days it might be simpler to embed Lua.

Re: Why Fennel?

#128

Fennel is nice. I converted my neovim config[1] to fennel and haven't looked back. [1]: https://github.com/Grazfather/dotfiles/blob/master/nvim/fnl/...

If only there was an editor which could act as an interpreter for Lisp directly ...

I understand it's improved, but Emacs was always too slow for me.

Additionally, in my workflow I open my editor across many many terminals, the startup time alone prevented this. With emacsclient it was faster, but I specifically DON'T want to have a window that shows all my other open files.

Re: Why Fennel?

#130
post #52

Earlier quoted context omitted.

I haven't really touched my emacs config in years. I just set it up how I wanted and now I use it to pay my bills. It sounds like the flexibility was just too tempting for you to not hack on it when you should be doing other things.

I have set it up 50 times and it crapped the bed every time. Before anyone yells "skill issue!", I'll say that if any plugin author can make the editor crap the bed, then the editor is not good. There are degrees to freedom. Complete freedom in such environments is a liability, not an asset. Say hi to the others in the ivory tower. And remind them not to do selective omissions in their supposed counter-arguments to "…

I know you're being down voted, but I've struggled with my Emacs config breaking quite frequently over the years. Nearly all of the breakages were due to plugins. I assume these breakages would be far less common if I was only using old plugins like Helm. But I like fancy new plugins that bring new functionality and smooth UX. They just seem to make breaking changes a lot more often. As far as performance goes, Emacs is roughly equal to VSCode IMO. It sometimes chokes on large files, but in general works well enough for me. To be fair, I've had trouble with Neovim + plugins becoming sluggish as well.
Post reply on HN