Live data from Hacker News

Why Fennel?

fennel-lang.org

91–100 of 106 posts

Re: Why Fennel?

#91
post #55

Earlier quoted context omitted.

What else is there apart from an editor and a lispy config language? I always thought of emacs as that, i.e. an editor that is extensible and dev friendly (in contrast to vimscript). I don’t know much about emacs though, so this got me curious.

Well the famous joke is "Emacs is an OS that lacks a decent text editor." (Yes Evil mode exists) Emacs can do basically anything you write an extension for it to do. It can be your calendar, your email client, your rss reader or even your git gui on top of being an editor. Emacs can do so much that it's daunting to start using.

> Emacs can do basically anything you write an extension for it to do. It can be your calendar, your email client, your rss reader or even your git gui on top of being an editor. Emacs can do so much that it's daunting to start using.

Vim can do all of those things.

Re: Why Fennel?

#92
post #75

> Finally Fennel includes a macro system so that you can easily extend the language to include new syntactic forms. This feature is intentionally listed last because while lisp programmers have historically made a big deal about how powerful it is, it is relatively rare to encounter situations where such a powerful construct is justified. In other words, there are serious drawbacks to using macros that are usually ou…

False, like with any feature there are use cases where macros make sense.

Re: Why Fennel?

#93
post #65

> Another common criticism of Lua is that it lacks arity checks; that is, if you call a function without enough arguments, it will simply proceed instead of indicating an error. Fennel allows you to write functions that work this way (fn) when it's needed for speed, but it also lets you write functions which check for the arguments they expect using lambda. I don't understand this; why is this a speed consideration?

It's a runtime check. The following fennel: (fn add-1 [x] (+ x 1)) (lambda add-2 [x] (+ x 2)) transpiles to the following lua: local function add_1(x) return (x + 1) end local function add_2(x) _G.assert((nil ~= x), "Missing argument x on /home/sullyj3/tmp/fn-vs-lambda/fnl/x.fnl:3") return (x + 2) end return add_2

Gotcha - thanks!

Re: Why Fennel?

#94
Also interesting is the language the original author of fennel then went on to make (with the knowledge gained by creating fennel): https://janet-lang.org

Still has a smaller community though and less appeal in the indie game scene

Re: Why Fennel?

#95
post #61

Earlier quoted context omitted.

This is mostly based on my experience in the past with Lua circa 2015 when I developed a GUI using Crank Storyboard Engine and needed to write some stuff in C because the Lua equivalent code was too CPU-intensive. If I remember correctly, Lua is a stack-based VM. What this means is that every piece of data has a corresponding location on a stack data structure in-memory. Function arguments are pushed into the stack a…

Lua is a register based VM.

It was stack based before 5.0

Re: Why Fennel?

#96
post #85

So I don't think I have a strong stance on the merits or drawbacks of whitespace-significant languages versus those that use parentheses (or any other syntax choices). But, I'm curious if there are any compelling arguments that objectively demonstrate why one approach might be superior to the other or if there are at least some persuasive reasons to favor one over the other. Genuinely curious!

I think (and am not alone) that indentation based languages are easier for beginners to learn. The fact that indentation (whether significant to syntax or not)helps readability is something I hope I need not demonstrate since indenting is near universal in languages that use explicit delimiters. So beginners learning a language with delimiters need to learn both delimiters and indentation, and then learn that while t…

Depends on the person. I knew some newbie programmers who loved Clojure and were hum-drum with Python.

Some folks like parenthesis delimiters and functional programming. It structures and separates things out clearly in their mind. And when you introduce them to editing tricks like parinfer - they fall in love. The guy whom I introduced Clojure to knows it far better than me now.

Re: Why Fennel?

#97

Earlier quoted context omitted.

Well the famous joke is "Emacs is an OS that lacks a decent text editor." (Yes Evil mode exists) Emacs can do basically anything you write an extension for it to do. It can be your calendar, your email client, your rss reader or even your git gui on top of being an editor. Emacs can do so much that it's daunting to start using.

> Emacs can do basically anything you write an extension for it to do. It can be your calendar, your email client, your rss reader or even your git gui on top of being an editor. Emacs can do so much that it's daunting to start using. Vim can do all of those things.

> Vim can do all of those things.

You can build a graphics editor in the browser, but it probably will never reach the level of Photoshop. Emacs can emulate Vim to a fairly good extent. However, I don't think Vim can ever surpass Emacs in terms of power and extensibility. It's simply the way Emacs is built. I love Vim, and I am a die-hard Vimmer. But I have to admit there are things that work in Emacs in a way that no other editor, whether it's Vim, VSCode, or anything else, does better.

Re: Why Fennel?

#98

In there it says Lua uses 'for' for looping over integer ranges and object ranges. They didn't like that so they broke it up so that for is for integer ranges and each is for object ranges. That seems strange to me. A range is a range so why have different ways to iterate over ranges based on what type of range it is?

Ranges are not a first-class object in Lua, the range-based for loop is basically a hardcoded special case.

Re: Why Fennel?

#99
post #50

Earlier quoted context omitted.

The referenced list seems to include a language for every taste; Fennel is also there as one of ~10 Lisp variants.

Like I said, if one likes Clojure but has to write for a Lua-enabled platform, Fennel is the best choice today, since there's no Clojure dialect for Lua, like ClojureScript or ClojureDart. Fennel although inspired by Clojure, still a very different language. Phil Hagelberg, AKA @technomancy, is the maintainer, a well-known and highly respected Clojurista.

i was wondering why it looked so clojure-y. thanks :)

Re: Why Fennel?

#100
post #90

So I don't think I have a strong stance on the merits or drawbacks of whitespace-significant languages versus those that use parentheses (or any other syntax choices). But, I'm curious if there are any compelling arguments that objectively demonstrate why one approach might be superior to the other or if there are at least some persuasive reasons to favor one over the other. Genuinely curious!

Structural editing, macros, homoiconicity.

Thanks. These are reasons in favor of parens, right?
Post reply on HN