TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

#lang Lua

101 pointsby Bogdanpover 2 years ago

8 comments

gyulaiover 2 years ago
I feel the need to ramble slightly OT on how great Lua is: I was looking for an architecture&#x2F;tech stack recently that would allow me to develop a cross-platform desktop GUI. I went on a several-weeks-long fact finding mission (the longest of its kind I&#x27;ve ever done in my 10 years as a professional software developer).<p>The option that won was to write all business logic (a few thousand lines of code) in Lua, then write the GUI in each platform&#x27;s native language+ui-library combination and re-use the same business logic by embedding Lua.<p>Another option that made the shortlist was using Haxe instead of Lua, but after several weeks of active Haxe development, it became clear that that was a bad idea, and with Lua, the developer experience is now so much better.<p>I definitely plan on continuing to use Lua as my main programming language.<p>This comes after 20 years of having python as my main programming language because I&#x27;m displeased with feature creep and bloat on python. With lua, I find that I barely miss any features&#x2F;abilities from the vastly more complex python while the simplicity of lua means my code gets to &quot;go places&quot; where python can&#x27;t go.<p>With lua, you find casual implementers making fully compatible alternative implementations (e.g. NeoLua for C#, Luna for Java, fengari for JavaScript, ...) With Python, alternative implementations seemingly just can&#x27;t keep up with the pace at which CPython is introducing unnecessary new features and CPython-compatbility is de-facto the only meaningful python standard there is. Jython and IronPython would make the platform so much more appealing, but they appear dead in the water. Python implementations for the browser pop up every couple of years only to see little adoption and quietly disappear again.<p>What&#x27;s more: Once you&#x27;ve settled on Lua as an embedding language, developers of Lua logic are free to use not just Lua, but they can pick from a host of cool transpile-to-Lua languages [1].<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;hengestone&#x2F;lua-languages" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hengestone&#x2F;lua-languages</a>
评论 #33581254 未加载
评论 #33581463 未加载
评论 #33581169 未加载
PenguinCoderover 2 years ago
Lua is a great language, simple enough to start with and do something with. Lightweight and fast. I love using Lua even though I hate having to reinvent every library worth of functions I constantly want to use elsewhere. Lua rocks is okay but I don&#x27;t really like using it. Lua has a Simple syntax, easy to grasp but hard to master and achieve complexity with.
评论 #33581837 未加载
评论 #33582130 未加载
andrewmcwattersover 2 years ago
Bogdan, not sure if this interests you since you&#x27;ve already commented on your approach in the article, but at Planimeter we use some utility scripts based on some comments at StackOverflow by Jonathan Leffler that help autogen LuaJIT FFI bindings. We started the luajit-ffi-bindings[1] tag at GitHub.<p>If you&#x27;re ever interested in their practical usage, Google me and let me know.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;topics&#x2F;luajit-ffi-bindings" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;topics&#x2F;luajit-ffi-bindings</a>
评论 #33587018 未加载
armchairhackerover 2 years ago
Implementing Lua is a great way to test out your language-generating program, since Lua is an extremely simple yet popular language. CLISP or Scheme is also a great test language...though Racket already has that covered.<p>It would be interesting to see someone implement a language like Python, C (interpreted or compiled to ASM), or Java in Racket. But it would also be an insane amount of work, probably to the point where you&#x27;re almost just re-implementing the language, and I also wonder if Racket would get really slow or crash due to all of the complexity.
评论 #33578410 未加载
评论 #33579188 未加载
gus_massaover 2 years ago
&gt; <i>a couple things are still missing lexer support (long brackets, scientific notation for numbers)</i><p>How much of the standard Lua test suit can your implementation pass? Do you have some benchmarks to compare the speed?<p>What is the problem with scientific notation? Racket can parse floating point numbers, including some weird cases [1], but I guess Lua has a slightly different set of weird cases.<p>[1] From <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15628989" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15628989</a><p>&gt; <i>Eli Barzley pointed out that Racket[BC] reads #e#x+e#s+e-e#l-e as a number.</i>
评论 #33580535 未加载
LAC-Techover 2 years ago
<i>I’m currently working on a macOS app that’s built with Racket and allows the user to write small scripts to process and filter some data. While Racket is definitely my preferred language and I could easily use it for these scripts, my target audience for this app would probably appreciate a more familiar language.</i><p>I&#x27;d love to script something in racket, over lua.<p>Is basic racket scripting even more challenging? I guess some programmers are allergic to s-expressions. But if you gave them a DSL, you could get something wonderfully expressive.<p>Dunno. Hard for me to imagine someone grokking Lua metatables but being terrified of parens.
评论 #33581049 未加载
lastdongover 2 years ago
Love the language and how much has grown, but could never get past the 1-based indexing of table arrays.
评论 #33582254 未加载
评论 #33616261 未加载
评论 #33581414 未加载
felipelalliover 2 years ago
Good job!