Hacker News new | ask | show | jobs
by _ugfj 749 days ago
The fanaticism of Rust programmers are well known and off putting. Why, one of them just posted about it into a Lua thread. It couldn't be less relevant. Much as I don't have a hard choice between picking assembly and PHP for a task, Rust and Lua are just not in the same problem space.
4 comments

I read his post less as Rust fanaticism and more someone who has learned their first programming language isn't perfect - strong types? iterators? These are all things that are present in many languages, it just sounds like Lua is lacking them and he is discovering some of the cool features of other languages.
But lua isn't lacking them, <for in do> is for generators, and if you want iterators you can make those as well.
Do you know if Lua supports type annotations or gradual typing? I use those heavily when using dynamically typed languages.
It does not. The most viable solution is transpilation, teal is the most recent candidate.

You can have a hack of sorts using a schema and tables as in

local schema = { a = "number", b="string" } -- key = "type" local data, link = {a=4, b="default value"}, {} -- link -> data, link itself is always empty local tbl = setmetatable(link, { __index = data , __newindex = function (t,k,v) if schema[k] and type(v)==schema[k] then data[k] = v return true end error"type does not match schema" end })

tbl.b = 5 -- this will error because its the wrong type

There are certain solutions you can do with functions, lsp is also really good at telling you when you went wrong.

No, Lua does not, but check out Roblox's Luau which is a gradually typed extension of Lua.
I'd recommend teal because luau is not really lua.
People complaining about Rust evangelism is about as much of a trope as the Rust evangelism.

Though I would rather spend my days listening to people talk about what they love rather than what they hate, so your response is more tiresome than the person you're replying to.

I think they are. Rust is a general purpose programming language, and Lua is a language specifically designed to be embeddable. But that means if you're making a project that embeds Lua, like Factorio for example, you have the choice of what language you write the code in. The choice is whether to write a function as native or to write it in Lua, and that choice might not be super clear unless someone else already made that choice for you.

This is completely different than assembly vs PHP. Assembly is a 'don't use it unless you have to' programming language, while PHP is a programming language designed for website building. You wouldn't use assembly to make a website because there are no frameworks for it and you'll scream and cry. You wouldn't use PHP to write the entrypoint to your operating system because PHP can't do that.

Rust and Lua are a lot closer together than PHP and assembly and it often would be reasonable to compare these languages for the same problems. It's not relevant at all to the blog post though because the engine they're using is built for Lua, and it's not really up to them unless they want to work against the engine and try to use a different language.

> Rust and Lua are a lot closer together than PHP and assembly.

Perhaps for some definition of closer, but they are very far away still.

Like opposite-ends-of-many-spectra far away.

Amusingly I’ve gotten more job offers for web software written in assembly than PHP
I think he was just offering the perspective of someone else that has also written a lot of Lua.

> The fanaticism of Rust programmers...

Honestly the endless criticism of Rust "fanatics" is far more tedious than anything Rust developers say. Rust is a fantastic language. Do you expect people not to talk about it?

> I think he was just offering the perspective of someone else that has also written a lot of Lua.

This is what I was going for, but I am a recent Rust convert and cannot help myself from gushing over Rust. Sorry!

> Honestly the endless criticism of Rust "fanatics" is far more tedious than anything Rust developers say.

We can agree to disagree. I am sick and tired of Rust people screaming at the top of the lungs in every possible place about how their language is great and want to rewrite everything in it.

So yes I expect people not to praise Rust in a Lua thread, it's completely off topic.

Rust's ecosystem is also very sporadic. It seems everyone jumped on board in the gold rush (and still do), reinvent the wheel in some package to lay claim, and then abandon it when its 70% there once they get bored and/or realize rust doesn't magically solve programming.
There was an article related to that recently:

https://loglog.games/blog/leaving-rust-gamedev/#gui-situatio...

That isn't really about people abandoning GUI development. Most of the big Rust GUI efforts are still going. The problem with Rust GUI libraries is that Rust isn't really old enough to have mature ones yet.
> The problem with Rust GUI libraries is that Rust isn't really old enough to have mature ones yet.

Rust is between 14 and 18 years old now. Depending on who you ask. [0]

If anything that's a testimony to what bmitc wrote.

> Rust's ecosystem is also very sporadic. It seems everyone jumped on board in the gold rush (and still do), reinvent the wheel in some package to lay claim, and then abandon it when its 70% there once they get bored and/or realize rust doesn't magically solve programming.

[0] https://en.wikipedia.org/wiki/Rust_(programming_language)#Hi...

People also talk about other languages in this thread. It rather seems to me that you are just a hater.