~technomancy/fennel-lang.org

a3046bf336f64e3f422d9bee920654d38e41b8ad — Phil Hagelberg 15 days ago 31d34d3
Write-up for the 2022 survey.
M survey/Makefile => survey/Makefile +3 -3
@@ 1,13 1,13 @@
upload: index.html save.cgi thanks.html 2021.html
upload: index.html save.cgi thanks.html 2021.html 2022.html
	rsync -rAv $^ fenneler@fennel-lang.org:fennel-lang.org/survey/

index.html: survey.fnl questions.fnl
	../fennel/fennel --add-fennel-path "../?.fnl" $< > $@

2021.html: summary.fnl chart.fnl questions.fnl pull commentary/2021/*
2021.html: summary.fnl chart.fnl questions.fnl commentary/2021/*
	../fennel/fennel --add-fennel-path "../?.fnl" $< 2021 > $@

2022.html: summary.fnl chart.fnl questions.fnl pull
2022.html: summary.fnl chart.fnl questions.fnl commentary/2022/*
	../fennel/fennel --add-fennel-path "../?.fnl" $< 2022 > $@

repl:

A survey/commentary/2022/10.txt => survey/commentary/2022/10.txt +1 -0
@@ 0,0 1,1 @@
I need to find a better way to visualize these results.

A survey/commentary/2022/11.txt => survey/commentary/2022/11.txt +2 -0
@@ 0,0 1,2 @@
Roughly the same distribution as last year, except shifted up by one,
with plenty of fresh-faced new arrivals, which is great to see.

A survey/commentary/2022/12.txt => survey/commentary/2022/12.txt +3 -0
@@ 0,0 1,3 @@
As imbalanced as these results are, they're at least shifting in the right
direction from last year. It's great to see more diversity, but we still have a
long way to go.

A survey/commentary/2022/13.txt => survey/commentary/2022/13.txt +5 -0
@@ 0,0 1,5 @@
Python has jumped up to beat out Javascript, which has fallen to a
position tied with Lua. I forgot to add Rust on last year's survey,
but it got a couple mentions in "others", and now it's tied with
C. Clojure remains strong which is unsurprising given the connection
with Fennel's roots.

A survey/commentary/2022/14.txt => survey/commentary/2022/14.txt +6 -0
@@ 0,0 1,6 @@
Again the answers here are all over the place, but the most common
answer was from the Fediverse/Mastodon. Second place was from the
NeoVim community, which continues to be very active in its Fennel
usage. Link aggregator sites like Lobsters, Hacker News, and Reddit
were also a common theme. Unlike last time, no one mentioned coming
from any Lua-specific communities other than TIC-80.

A survey/commentary/2022/15.txt => survey/commentary/2022/15.txt +7 -0
@@ 0,0 1,7 @@
Great to see Libera IRC still at the top of this list. Matrix has
jumped up and is now pretty close to IRC. (These are
bridged together so it really feels like one place with two different
ways to access it.)  The Fediverse jumped up higher as well. If you
picked "nowhere", check out one of these options; the community is
active and lively! The "other" responses included a few different
discords but not really any overlap between them.

A survey/commentary/2022/17.txt => survey/commentary/2022/17.txt +7 -0
@@ 0,0 1,7 @@
The config/dotfiles option is new this year, and it sure got a lot of
responses.

Other than that, we've got a few more people using it at work, which
I'm super curious to know more about, but most people are doing so
secretly, so I guess we won't be hearing too much about them. But it's
still a very small percent of the overall responses.

A survey/commentary/2022/18.txt => survey/commentary/2022/18.txt +7 -0
@@ 0,0 1,7 @@
Programs which have first-class Fennel support has leaped up here from
near the bottom to second place, so that's an exciting
development. Interesting that AOT-compiling is still in first
place. This could be because for a proper release, this approach gives
you the fastest startup time, or it could be because people run into
difficulties trying to embed the compiler. Maybe these can be split
into different options next time.

A survey/commentary/2022/19.txt => survey/commentary/2022/19.txt +1 -0
@@ 0,0 1,1 @@
NeoVim has unseated the long-time champion of LÖVE; very impressive!

A survey/commentary/2022/2.txt => survey/commentary/2022/2.txt +1 -0
@@ 0,0 1,1 @@
This is one question where I expect things to have changed substantially since last year! Only one person is using a version of Fennel which even existed last year.

A survey/commentary/2022/20.txt => survey/commentary/2022/20.txt +17 -0
@@ 0,0 1,17 @@
Everybody loves simplicity, consistency, and regularity; real
crowd-pleasers here! The repl has jumped up to second place, which is
great.

Last year we had "access to Lua ecosystem" which was a little
vague; this year it was split out into one option for Lua libraries
and one for applications that have Lua support in them. It turns out
that the applications one is a little higher than the libraries, but
libraries still score quite high.

I also love that people value community so much that it's tied here
with macros. It really is one of the highlights of working with Fennel.

Overall what I'm seeing here is a strong showing of appreciation for
features we inherit directly from Lua, but an even stronger
appreciation of the features Lua lacks that Fennel adds on top, such
as simpler syntax, a powerful repl, and pattern matching.

A survey/commentary/2022/21.txt => survey/commentary/2022/21.txt +40 -0
@@ 0,0 1,40 @@
Whew; OK here we go.

The #1 problem is better editor support, and only two votes behind we
have better tooling support. Does this mean people using NeoVim and
Emacs (the top-scoring editors) want better support, or does it mean
that people want support for a wider variety of editors? The good news
here is that the past few months have seen a flurry of development on
fennel-ls, an implementation of the Language Server Protocol for
Fennel: https://git.sr.ht/~xerool/fennel-ls This actually should help
address both of the above: it improves the features available in Emacs
and NeoVim, and it also makes those features usable from a broader
variety of editors. Give it a try!

It's interesting that the Lua library ecosystem comes out as #3 here
when lots of people count the Lua library ecosystem as one of their
favorite features of Fennel. I'm guessing this means Fennel has a big
lead over small lisps which aren't hosted on an existing platform, but
still lags far behind Clojure when it comes to libraries.

We split out confusing errors from last year into runtime vs
compile-time. The good news is the compile-time errors (the ones we
can actually control) came in last, so those seem to be working great!

Unclear documentation scored very low too, which is encouraging. It
looks like the main documentation thing people are having trouble with
is Lua itself firstly, and then how to build applications and
libraries secondly. So that's useful direction when it comes to
improving the docs.

Reluctance to introduce a new language to teammates shot way up this
year, which tells me that a lot more people are thinking about using Fennel at
work, but can't quite get to the point of justifying it yet. We'll see how
this develops over time but I think we'll probably start to see the
number of people using it work rise substantially in future years.

One person wrote about getting tripped up from differences with other
lisps. Fennel is closest to Clojure, so there's a guide for those with
a Clojure background at https://fennel-lang.org/from-clojure but
perhaps we'd benefit from a similar guide for folks coming from Scheme
or CL?

A survey/commentary/2022/22.txt => survey/commentary/2022/22.txt +1 -0
@@ 0,0 1,1 @@
Looking forward to getting these compiler contributions!

A survey/commentary/2022/24.txt => survey/commentary/2022/24.txt +44 -0
@@ 0,0 1,44 @@
Answers in the free-form section were all over the place, but the top
recurring theme was LSP support, so as mentioned above, we're on the
right track with that!

The next thing was to improve the compiler output. There are two
different classes of problems here. The biggest one is to change how
functions are compiled; right now they can never be compiled to an
anonymous value but always get bound to a local before they can be
used. This is due to a specific assumption about how the compiler
output is stored which is baked in pretty deep, and it would be a lot
of work to change: https://github.com/bakpakin/Fennel/issues/384

The other problem is easier to address; there are several places in
the code where we assume whatever code is being compiled could do
basically anything, so we have to take somewhat extreme measures. For
instance, naively compiling (= (x) (y) (z)) into Lua where operators
are all binary would be something like (x() == y()) and (y() == z())
which calls y twice; this is real bad! So we use an inline function to
avoid this. But the compiler could detect that in other cases like (=
a b c) that there's no need; the naive expansion is fine in that
case. We just don't do enough analysis at this point to tell the
difference, and we err on the side of caution. If you're interested in
contributing to the compiler, this would be a great place to start.

Some people really want Fennel to have a standard library. I get where
this is coming from; I really do. But it's really hard to imagine how
we could do a better job than existing libraries like Lume or
LuaFun. The whole point of Fennel is that the interop with Lua is
completely seamless. Different situations call for different things,
and making everyone pay the runtime cost of bringing along a bunch of
functions they don't need really doesn't feel like the right answer
here, especially when the alternative of "cp ../lume/lume.lua lib"
doesn't really have any downsides.

Reinforcing the above, another common thread here was that Fennel's
simplicity is its greatest strength, and people don't want it to
change in a way that makes it more complex. "Fennel is a lang that
fits in my head. I hope it stays that way." I hope so too.

Finally we had a couple people who were on Windows and wished for a
smoother install process on there. I'm afraid that's not something we
can do with the expertise we have among the current Fennel
contributors, but if some Windows users want to step up and help with
that, it would be appreciated.

A survey/commentary/2022/25.txt => survey/commentary/2022/25.txt +14 -0
@@ 0,0 1,14 @@
Here are a few of the neat things shared!

> A small repl for neovim: https://git.sr.ht/~szgy/dotfiles/tree/main/item/.config/nvim/fnl/repl.fnl , an IRC client library: https://git.sr.ht/~szgy/fnlirc , A terminal IRC client: https://git.sr.ht/~szgy/maguey

> The most recent thing I wrote in Fennel was a web server that sends SMS (text messages). https://gti.telent.net/dan/grafana-sms-alert

> https://git.sr.ht/~nasser/8fl [a music tracker composition tool]

> I used this to generate my homepage for the longest time: https://git.m455.casa/wg :)

> This is about the only thing I've published https://github.com/harrygallagher4/nvim-parinfer-rust/

> I have a bunch of private tools, but I do have one public project in Fennel which might be interesting to others: https://git.madhouse-project.org/algernon/synodic-period
It's a monitoring system. Quite opinionated, and closely tailored to my own needs. It's main purpose is to feed data into Riemann, upon which I can build a personal, private dashboard

A survey/commentary/2022/26.txt => survey/commentary/2022/26.txt +30 -0
@@ 0,0 1,30 @@
We got an outpouring of support and good vibes here.

> I tried to give helpful feedback here but I'm extremely satisfied with Fennel and very rarely run into an actual problem. Thanks for the great project!

> Keep up the awesome community and welcoming environment :)

> This project is great and already delivers a great deal, so thank you!

> stay cozy, fennel community <3

> Keep up the great work! Fennel is tons of fun to write, and has consistently been an enjoyable language to build with. The community is filled with wonderfully kind and talented folks who deserve as much praise as possible!

This puts into words something I've felt for a while:

> fennel is what I wished to find in scheme: a language that uses few data structures (like clojure), with simple & powerful semantics and not much magic under the hood (unlike clojure). thank you for making it real :) hope it can be what clojure became: a power amplifier for small teams and individuals.

This is also something that comes up every so often:

> Prefix < is still somewhat counterintuitive sometimes.  Would be nice to have built-in positive?, zero?, negative? like Racket

I used to have this problem too! When you think of < as "greater than"
it's confusing because you're accustomed to infix notation where the
big end points to the bigger number. In prefix notation, there can be
any number of arguments! So rather than calling it "greater than",
it's more intuitive to call it "increasing?"; that is, are all the
arguments to this in increasing order, or not? Once I started thinking
this way, I found it to be a lot less error-prone.

Thanks to everyone for their input, and see you next time! Drop by the
chat and/or mailing list if you'd like to discuss anything here further.

A survey/commentary/2022/3.txt => survey/commentary/2022/3.txt +2 -0
@@ 0,0 1,2 @@
Almost identical results here from last time, except PUC 5.1 has gone
down a bit, which is good news as far as I'm concerned.

A survey/commentary/2022/4.txt => survey/commentary/2022/4.txt +2 -0
@@ 0,0 1,2 @@
Still a good chunk of people using LuaRocks, but the percentage has
gone down a bit since last year.

A survey/commentary/2022/5.txt => survey/commentary/2022/5.txt +6 -0
@@ 0,0 1,6 @@
Last year we didn't have WSL broken out from other Windows; you can't
tell it from this graph because it doesn't show who selected both
options, but slightly over half the Windows users (5/9) do use
WSL. Meanwhile MacOS gained a little bit of ground.



A survey/commentary/2022/6.txt => survey/commentary/2022/6.txt +4 -0
@@ 0,0 1,4 @@
Visual Studio Code leaps up to third place (it only had 3 users last
time) but it has a very long way to go to beat Emacs, and NeoVim
remains #1, but Emacs is catching up! Helix was mentioned a couple
time in "other".

A survey/commentary/2022/7.txt => survey/commentary/2022/7.txt +3 -0
@@ 0,0 1,3 @@
Not much change here; glad to see a strong showing but might retire
this question next year since it feels like we learned what we wanted
to know from it.

A survey/commentary/2022/8.txt => survey/commentary/2022/8.txt +0 -0
A survey/commentary/2022/9.txt => survey/commentary/2022/9.txt +5 -0
@@ 0,0 1,5 @@
Roughly the same breakdown as last year, but this year we have our
first users in the single-digit age bracket with a pair of 5-year old
twins; I love to see this! Coding Fennel as a family activity is
so wholesome.


A survey/questions-2022.fnl => survey/questions-2022.fnl +210 -0
@@ 0,0 1,210 @@
(local questions [])

(fn q [question type answers]
  (table.insert questions {: question : type : answers}))

(q "Versions and Ecosystem" :section)

(q "What versions of Fennel do you use?" :checkbox
   ["latest from git"
    "1.2.0"
    "1.1.0"
    "1.0.0"
    "0.10.0"
    "0.9.x"
    "0.8.x"
    "older"])

(q "What versions of Lua do you use? (PUC is 'regular' Lua)" :checkbox
   ["LuaJIT"
    "PUC 5.4"
    "PUC 5.3"
    "PUC 5.2"
    "PUC 5.1"
    "fengari"
    "luaj"
    "rembulan"
    "moonsharp"
    "luerl"
    "gopher-lua"
    "Other"])

(q "Do you use LuaRocks?" :checkbox
   ["Yes, to install applications/tools (luacheck, lua-repl)"
    "Yes, to manage libraries in my codebase"
    "No"])

(q "What OS do you use?" :checkbox
   ["MacOS"
    "Linux-based"
    "Other BSD-based"
    "Windows (with WSL)"
    "Windows (not WSL)"
    "Other"])

(q "What text editor do you use for Fennel?" :checkbox
   ["Emacs"
    "NeoVim"
    "Vim"
    "VS Code"
    "Kakoune"
    "Vis"
    "Notepad ++"
    "Lite"
    "Other"])

(q "Do you use readline in your repl?" :checkbox
   ["Yes"
    "No, the repl I use has readline features already (Emacs, etc)"
    "No, I haven't bothered to get it installed"
    "No, I don't find it useful"
    "No, I don't use the repl"
    "What is readline?"])

(q "Tell us a bit about yourself (remember, optional!)" :section)

(q "What is your age?" :number)

(q "How many years have you been programming?" :number)

(q "How many years have you used Fennel?" :number) ;; check

(q "What is your gender? (extra-optional)" :text)

(q "Other than Fennel, what languages do you use regularly?" :checkbox
   ["Lua"
    "Clojure"
    "Javascript"
    "Java"
    "Python"
    "Ruby"
    "C"
    "C++"
    "C#"
    "Emacs Lisp"
    "Scala"
    "Go"
    "PHP"
    "Racket"
    "Rust"
    "Scheme"
    "Common Lisp"
    "Kotlin"
    "Haskell"
    "OCaml"
    "Erlang"
    "Forth"
    "Julia"
    "Zig"
    "Other"])

(q "Where did you hear about Fennel?" :text)

(q "Where do you discuss Fennel or interact with other Fennel developers?" :checkbox
   ["Libera Chat (IRC)"
    "Matrix"
    "The official mailing list"
    "Fediverse"
    "Twitter"
    "Reddit"
    "Hacker News"
    "Other chat platforms"
    "Nowhere =("
    "Other"])

(q "How do you use Fennel" :section)

(q "How would you characterize your use of Fennel?" :checkbox
   ["I use it for personal code that I haven't shared with others"
    "I use it to make games"
    "I use it at school"
    "I use it for web applications"
    "I use it for sysadmin tasks"
    "I use it to make music"
    "I use it for other hobby projects"
    "I use it for config/dotfiles"
    "I use it at work (secretly)"
    "I use it at work (openly)"
    "Other"])

(q "What does your use of Fennel look like?" :checkbox
   ["I embed the whole Fennel compiler in larger programs"
    "I compile my Fennel code to Lua, which I then embed"
    "I use programs which have first-class Fennel support"
    "I compile standalone programs as scripts"
    "I compile standalone binaries"
    "Other"])

(q "What programs do you use Fennel with?" :checkbox
   ["NeoVim"
    "LÖVE (love2d)"
    "TIC-80"
    "nginx/OpenResty"
    "awesome-wm"
    "Minetest"
    "LOVR"
    "NeoMutt"
    "mpv"
    "luvit"
    "hammerspoon/spacehammer"
    "Other"])

(q "What are your favorite features of Fennel? (pick up to 5)" :checkbox
   ["Consistent and regular syntax"
    "Interactive development/repl"
    "Simple semantics"
    "Pattern matching"
    "Strict global checking"
    "Small size, low memory usage"
    "Community"
    "Speed"
    "Macros"
    "Access to applications with Lua"
    "Access to Lua libraries"
    "Modules"
    "Metatables"
    "Coroutines"
    "Nil-argument checks"
    "Readable compiler output"
    "Require-as-include"])

(q "What are the biggest problems you have using Fennel? (pick up to 5)" :checkbox
   ["Reluctance to introduce new languages to projects with teammates"
    "Lua library ecosystem is relatively small"
    "Unfamiliarity with Lua"
    "Lack of immutable data structures"
    "Lack of static types"
    "Non-first-class arithmetic operators"
    "Need better editor support"
    "Need better tooling support"
    "Portability across Lua versions"
    "Unclear documentation"
    "Confusing error messages (runtime)"
    "Confusing error messages (compile-time)"
    "Too slow (runtime)"
    "Too slow (compile time)"
    "Unclear how to build applications and libraries"
    "Unclear how to incorporate libraries into your build"
    "No runtime functions (need lume/luafun/penlight for common operations)"
    "Unpleasant community interactions"
    "No early returns"])

(q "If you haven't hacked on Fennel itself, why not?" :checkbox
   ["It already does everything I want"
    "I tried but I couldn't understand it"
    "I haven't found the time but I hope to in the future"
    "I'm intimidated by compilers"
    "I have hacked on the compiler"])

(q "Wrapping up" :section)

(q "What would you most like to see in a future version of Fennel?" :textarea)

(q "Do you have any code you've written in Fennel you would like to share?"
   :textarea)

(q "Any other comments?" :textarea)

(q "Submit" :submit)

questions

M survey/summary.fnl => survey/summary.fnl +4 -2
@@ 56,6 56,7 @@
(fn normalize-rounding [x]
  (match (x:find "^([%d%.]+)")
    (_ _ digits) (-> digits (tonumber) (math.floor) (tostring))
    (where nil (x:find "%< *1")) "0"
    _ x))

(fn normalize-number [i response]


@@ 64,11 65,12 @@
             (normalize-rounding r)
             (normalize-decade r (= 10 i)))]))

(local aliases {:Male :male :M :male :m :male})
(local aliases {:Male :male :M :male :m :male :cismale :cis-male
                :F :female :woman :female})

(fn normalize-text [i response]
  (match response
    [r] [(or (. aliases r) r)]))
    [r] [(or (. aliases (r:gsub " +$" "")) r)]))

;; turn URLs in parens into [:a {:href "https://..."} "https://..."] tables
(fn link [text]

M survey/survey.fnl => survey/survey.fnl +6 -4
@@ 2,7 2,7 @@
(local foot (require :foot))
(local questions (require :questions))
(local year 2022)
(local closed? false)
(local closed? true)

;; each type of question gets its own HTML representation. section headers are
;; "questions" for the purposes of the data even though they don't have answers.


@@ 50,9 50,11 @@
             (if closed?
                 [:div {}
                  [:hr {}]
                  [:p {} "The survey is closed now; thanks for participating!"
                   "You can see" [:a {:href (tostring year)} "the results"]
                   "now."]]
                  [:p {} "The survey is closed now; thanks for participating! "
                   "We have results from:"]
                  [:ul {}
                   [:li {} [:a {:href "/survey/2022"} "2022"]]
                   [:li {} [:a {:href "/survey/2021"} "2021"]]]]
                 [:div {}
                  [:p {} "Welcome to the second annual Fennel survey. "
                   "Thanks for taking the time to help us understand "