shakedown.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A community for live music fans with roots in the jam scene. Shakedown Social is run by a team of volunteers (led by @clifff and @sethadam1) and funded by donations.

Administered by:

Server stats:

267
active users

#lua

3 posts3 participants0 posts today
While it has its own issues, there are several good reasons why my favourite #ProgrammingLanguage in the real world is #C

Why not #Go?
Because it's from #Google.

Why not #Csharp or #Fsharp?
#Microsoft.

Why not #Rust or #Zig?
#LLVM (aka #Apple & friends).

Ultimately, most of languages I avoid like the plague are controlled by #BigTech one way or another.

C is simple enough to get several alternative compilers based on useful standards.² ³


¹ In theory I still prefer #Oberon07, but when I want to code something useful I still use C instead to lower the entry barrier for other devs, because there are too many incompatible implementations of the compiler and "standard" library.

² Ok, #Python, #Scheme and #Lua have similar qualities, but for the tools I write I usually prefer binary executables with no runtime.

³ No, #C++ is not an option. 😉
harmful.cat-v.orgBjarne Stroustrup: "I Did It For You All..."

New software release today!

Just published v2.0 of Daemonparts, a collection of unix daemon boilerplate for #Lua. Next version of Nepenthes needed this out.

I think it's unlikely anything not made by me is using it, but it's 2.0 because there are some severe breaking changes.

Anyway if you're interested in daemonizing Lua scripts it's on LuaRocks, and documented here:

https://zadzmo.org/code/daemonparts

zadzmo.orgZADZMO code
Continued thread

Unfortunately, there are gotchas there, too.

(fn decide [request]
  Outcome.not_for_us)

This #fennel code compiles to the following #lua:

local function decide(request)
  return Outcome.not_for_us
end
return decide

The problem here is that I'm not require-ing this file. I maybe should. Without require, that return makes little sense, and the decide function won't be found in the global scope, so...

Error: error converting Lua nil to function

Which makes perfect sense. Except the error message is bad, and needs to be improved.

Today's adventures begin with trying to make #iocaine play well with #Fennel. There's work to be done on this front...

For starters, I don't think I will be able to support running the Fennel compiler as part of the init process. It seems to require debug and assert, which I'm not sure I want to make available to the Lua runtime in iocaine.

debug requires mlua.unsafe_new(), which in turn requires an unsafe block, and I'm not comfortable with that. Not even sure how I can make assert available, mlua doesn't seem to provide that as part of stdlib.

So, next best thing: compiling #Fennel to #Lua ahead of time!

Replied in thread

Ok, dispatch is in, some quick benchmarks, using a script that does nothing but return Outcome::NotForUs:

  • lua (luajit): 127k req/sec
  • lua (luau-jit): 142k req/sec
  • roto: 173k req/sec

So #Roto wins over #Lua by a sizeable margin here, even with luau-jit (which, iirc, is supposed to be the fastest).

However, #Lua is fast enough. I'm willing to trade some performance for user convenience, and Lua is at a spot where the performance drop, while noticable, is within acceptable limits, and is offset by the convenience of the language.

Replied in thread

In a number of ways, #Lua is going to be a better fit than #Roto: it's a far better known language, and a whole bunch of things are easier to do in Lua.

Do I regret going with #Roto first? Absolutely not. I like Roto's syntax better, and prefer its minimalism over Lua. From what I remember about my prior benchmarks, Roto is also significantly faster. But I'll do some side-by-side comparisons once the Lua support is in a better place, and once I can actually choose which one to use.

Right now I just made a struct that implements the same functions as MeansOfProduction, and replaced Roto with Lua. That is obviously not how it will work down the road.

I'm thinking of developing a new course or workshop in the fall.. would any of these interest you?

#webdev#svelte#html

Hello Fediverse. So I'm looking for a #remote #opensource job or project in European timezones.

I am not good in writing CVs. So I'm just listing the projects I have done:

I'm a #Linux user. I have good experience using CLI, and I have basic shell scripting skills. I also have a little experience with #FreeBSD

I am also good at reading academic papers, standards(like RFCs) and manpages.

I am up for working on #FOSS projects as freelancer or part time contracts.

Boosts appreciated :)

PS: I am also familiar with #CommonLisp. But I highly doubt if I can find a #Lisp job anywhere!

Codeberg.orgwakegpDetecting wake words using Linear Genetic Programming

Weekend goal: a #Lua chunk (script) to help sighted users review #Braille. It's a great way to understand how visually impaired users interact with a computer using a screen reader and a Braille display. The script is simple and easy to configure. Currently, it offers a learning mode; in the future, a challenge mode will be added, along with a blog post explaining how to set it up.

Link: gitlab.com/-/snippets/4858299

On #FreeBSD it should be executable via flua:
% flua learnbraille.lua

after installing liblouis:
# pkg install liblouis

[edit] % /usr/libexec/flua learnbraille.lua

after 25+ years of class-based OOP i'm learning to think in terms of prototype-based OOP. it's a subtle change, and wow does it ever loosen up my thought processes

instead of thinking top-down (and bottom up) about my game architecture and worrying about rational hierarchies, i'm learning how to think in terms of pure functionality and cloning and then extending objects.

it's a relief learning something new. i'm no longer forcing lua to be not-lua.

all of this is thanks to the smalltalk-80 reference book i picked up a few months ago, along with a great article on the history of smalltalk by alan kay

worrydream.com/EarlyHistoryOfS