Live data from Hacker News

LÖVE: 2D Game Framework for Lua

github.com

131–140 of 229 posts

Re: LÖVE: 2D Game Framework for Lua

#131
post #126

I used LÖVE to build a simple Kodi alternative for my home media center setup. My first attempt was using Electron but rewriting to LÖVE meant much simpler code (turns out manually calculating coordinates is simpler than fighting CSS) and less resource consumption (not a high bar, yes). It works so well I might clean it up and open source it...

What were your (main) problems with Kodi? AFAIK it is written in C++ with Python plugins. Electron would be (on the face) a downgrade yes. But how is a Lua app much smoother? (My personal pet peeve is that Kodi still doesn't know how to minimize CPU consumption when one is doing nothing on the UI. It should just stop rendering. This means I have to turn Kodi off on my HTPC+server setup to stop it from pushing my CPU…

Kodi is super complex. The last straw was me wanting to launch Dolphin games from the UI and not being able to figure it out.

My custom media center is basically just a glorified 10ft-UI file browser. Opens media files in mpv (with some extra GUI to download subtitles and select audio tracks), Wii games in Dolphin, runs shell scripts (I have ones launch Steam Link etc.)

I realize that this might be a case of "simplify by limiting use cases" but I made it for me so it's fine.

Re: LÖVE: 2D Game Framework for Lua

#132
post #16
post #13

Earlier quoted context omitted.

too bad universe doesn't ship with unobfuscated source so that you could see whether you're unlucky, or just skill issue

The source is right there, you just have to grok it.

that's great, could read the source code on how to unify gravity and quantum mechanics for all energy levels? vibeing to a nobel price will be cool...

Re: LÖVE: 2D Game Framework for Lua

#133

Earlier quoted context omitted.

Luajit is often faster than C. The qualities you described above actually make it great for game dev.

A JIT is a double edged sword, it _can_ make your code faster, i remember in the early days of smartphone gaming, developers often had to manually "warm up" the JIT to prevent stutters during gameplay It still is an issue nowadays https://discussions.unity.com/t/app-needs-warmup-first-slow-... Similar story with the GC, it's nice to have, until it causes you problems (wich it will), so you end up having to avoid usin…

True using a JIT without understanding it is not a panacea. Same as a GC. Same as malloc and free (you're often much better off with arena allocators).

Most JITs let you tune when and how they inline. It's also worth knowing how they works and what they can/can't inline.

You linked to monojit. Luajit is a whole other beast. I'd argue it's superior to anything in JS/JAVA/C# land (and I say that as someone with a reasonable understanding of the JVMs C2 JIT).

As an aside with low latency GCs like the JVM's ZGC trading manual memory management for no memory related security vulnerabilities is pretty appealing.

Like everything in programming it's a trade off.

Re: LÖVE: 2D Game Framework for Lua

#134
post #117
post #41

Earlier quoted context omitted.

Now why would you hate lua of all things?

In many aspects, Lua is more verbose and awkward than other similar languages. Compare local alive_enemies = {} for _, enemy in ipairs(enemies) do if not enemy.dead then table.insert(alive_enemies, enemy) end end enemies = alive_enemies with enemies = enemies.filter(enemy => enemy.alive)

It's more minimalistic, that's true. But there's nothing stopping you writing or downloading an array library so you can do this:

  enemies = array.filter(enemies, function(e) return e.alive end)
Or even setting a metatable so you can do:

  enemies = enemies.filter(function(e) return e.alive end)

Re: LÖVE: 2D Game Framework for Lua

#136
post #117
post #41

Earlier quoted context omitted.

Now why would you hate lua of all things?

In many aspects, Lua is more verbose and awkward than other similar languages. Compare local alive_enemies = {} for _, enemy in ipairs(enemies) do if not enemy.dead then table.insert(alive_enemies, enemy) end end enemies = alive_enemies with enemies = enemies.filter(enemy => enemy.alive)

well, it is true that the second one is more concise.

The only difference is that one of the language is embedded and barely takes any place. it's just a few C files :-D It offers just enough functionality while not making it overly complicated to make basic things.

The other one is way way bigger. and even Array.filter didn't exist from the start

Re: LÖVE: 2D Game Framework for Lua

#137

How is it supposed to be pronounced? Is it just gratuitous diacritics? Or should I pronounce it in my native Swedish (where the names makes me think of leaves rather than love)? (Throwing diacritics on English words look extremely silly to me, since I know how åäö are supposed to be pronounced. It makes something like Motorhead just sound laughable rather than metal.)

I am fairly certain it's a case of https://en.wikipedia.org/wiki/Metal_umlaut

Re: LÖVE: 2D Game Framework for Lua

#138
post #41

Earlier quoted context omitted.

Now why would you hate lua of all things?

Small stdlib, “implement it yourself” philosophy to even things like classes, diverging language versions and fragmentation (a lot of people don’t like any of the post 5.1 changes), bad tooling and editor support, dynamic duck typed language with no type hints

If it were about making a choice of which web framework to use on the server, obviously you wouldn't want to use Lua.

But if it is about using it as an embedded language. you want just enough language to get you started and be able to tweak controls. so that the embedded language itself doesn't take up unnecessary space, on its own.

It's a design choice to have a language as small as possible while still offering cool tools.

Re: LÖVE: 2D Game Framework for Lua

#139
post #51
post #16

Earlier quoted context omitted.

The source is right there, you just have to grok it.

Well, it's kind of a machine code for a self-modifying compiler, so there's that.

The source is not just dna - that's just one type of architecture that exists. There might be others that operate on different instruction sets.

The real source is mathematics. But some might say it's incomplete.

Re: LÖVE: 2D Game Framework for Lua

#140
post #117

Earlier quoted context omitted.

In many aspects, Lua is more verbose and awkward than other similar languages. Compare local alive_enemies = {} for _, enemy in ipairs(enemies) do if not enemy.dead then table.insert(alive_enemies, enemy) end end enemies = alive_enemies with enemies = enemies.filter(enemy => enemy.alive)

well, it is true that the second one is more concise. The only difference is that one of the language is embedded and barely takes any place. it's just a few C files :-D It offers just enough functionality while not making it overly complicated to make basic things. The other one is way way bigger. and even Array.filter didn't exist from the start

Alright, here is Janet, which is designed to be embeddable just like Lua:

  (set enemies (filter |($ :alive) enemies))
Though JavaScript has QuickJS, which is also lightweight.
Post reply on HN