Hacker Newsnew | past | comments | ask | show | jobs | submit | nmz's commentslogin

> Const keyword: changing const from `local a <const> = 42` to `const a = 42` is far better syntax. The bracketed syntax was never a good idea.

The bracketed syntax is an okay idea especially for <close>, adding close as a keyword would be a disaster given how common the word is. If anything, local should have been tossed away as a keyword and the bracketed syntax adopted completely

    v <local const close>, v2 = io.open'file', false
    g <global const> = 5

5.5 introduced global which makes better use of attributes as well. of course, I don't deny how great it would be to not type <> or local const since const would already imply a local

> string interpolation

Hisham already made this nice module https://github.com/hishamhm/f-strings Which I don't dare use, even if you don't have string interpolation. Of course, I don't care because I just have a table.format(tbl, "tbl.key is %{key}"), is it a little tedious? sure, but its just a gsub call.

> short form function syntax

I disagree with this, I've always wanted it and roll my eyes as I write/create a function, especially when you like to use lots of them like

    str:gsub('%d+', (s){ tonumber(s)+1 })
> Named varargs: It may be nice, but there is no real reason to add this. If you wanted a name for your varargs you could do `local name = ...` or just use the `args` variable already available in every function.

You've made a mistake there

    local name = ...
is

    local name = ({...})[1]

In order to actually do this you need to

   local name = table.pack(...)
If you will use a vararg, you will always have to do this, so why not just let it be handled in the parameter definition? its costless. AND lua5.5 already introduced this so it seems they liked it.

Quite frankly I would like the capability of treating ... as just an array like ...[1] but I haven't looked at the parser to see if its feasible or not.

> Switch/Match/Select Statements: An optimized if/else block works just as well and another expansion of a small language.

I don't disagree, but big table of functions is so ugly, switch statements would be nice


- Agreed on the bracketed attributes, the close attribute is very useful and devs would reach for the brackets more if they were like as you suggest. - short form fns: you and another commenter have given me good examples. I’m still not sure they are worth the complexity but I understand the use better now. - varargs true! Conceded!

Thanks for the comment! It’s helpful.


a lone ? can mean anything, you can already tell that . is for fetching a subtable.

In C# it's not a lone ?, it's two operators: ?. and ?[

Lua could have ?. ?[ ?" ?{ and ?(


This is something I don't see a lot of people do. I've tended to do

  for long,list,of,variables,here
  in ageneratorhere(bigparameterhere)
  do
  end
and

  local x do
    -- everything after is just here to define x
  end

I'm still a little irked it works so well, the only alternative would be for the language to have labeled blocks. but that might be too terse

No, not basically, it simply doesn't have them, Ternary means three as in it operates on 3 operands, and/or operates on 2 operands. They are also not equivalent.

   x = a ? b : c # x is b, same as you would if a {x=b} else {x=c}
lua and/or

    a,b,c = true, 1, 2
    x = a and b or c -- x is b


    a,b,c = true, false, 2
    x = a and b or c -- x is c
The or is dependent on its previous operand, so b will return false and skips to c, even if you meant for it to be b. you must use an if then else. However, you can have more than a ternary, if there is no need for short-circuit evaluation, as in, any of the operand is not a function CALL like c(), and you want to remain inside an expression, then you can do this instead

select (select is a native C function, this is faster than the table creation below)

    x = select(a and 1 or 2, b, c)
table creation/selection

    x = ({false,2})[a and 1 or 2]

of course, doing something like

   local x; if a then x=b else x=c end
does not look so bad

https://youtu.be/nepKKz-MzFM&t=7195

If you can stand Lex Friedman for a bit, the VLC authors talk about why you use ASM for a video decoder instead of pure C or rust.


Legalities aside, You can use compute how you want, that doesn't stop anybody from accurately measuring its usefulness. Given that this is an objective measurement.

I can have a computer on an endless loop without any idling, consuming as much CPU time as it can, I do not know any other classification of this action than wastefulness. crypto mining is useful of course, the end goal of mining is to get crypto, of course, there is no further goal beyond that.


How is it an objective measurement? What is useful and what is not useful? Is Minecraft useful? What does useful mean?


Via comparison of the solutions, we measure objectives and actions performed and the time it requires to do them.

Objectively, Minecraft is a game, an objective of many games is to waste time, therefore this cannot be used as a measurement, but enjoyment is. as a game it fulfills its role. wastefulness could be classified in comparison to other solutions/clones, like minetest. If minetest fulfills exactly the same goals with less action as minecraft, then minecraft is in comparison wasteful.

Another measurement is mining solutions can we achieve the action of mining with less compute? can we not mine at all? does not mining achieve the same goal? if it does, then mining is objectively wasteful.

The objective of crypto is replacing fiat currency, it does not do this, therefore it is wasteful. Of course, this is only true until it does replace it, which is why we must compare, would this cryptocoin scale to the entire world? does it require more work for it to do so? if so then it is wasteful.


Well, it seems he wasn't, he's not gonna get upvotes though, HN is startup culture and startup culture is selling dreams until it works or you notice too late you got robbed.

And who's gonna admit that bitcoin is a ponzi scheme when all of their savings are in it? you can't, it would devalue your own money, so you're trapped, you can only further invest in it.


So many people here know how bitcoin works but don't know that it doesn't.

It is hilarious.


It worked on ipv6 only for like a year, it seemed to be back this last month but it seems to be back down right now probably because of this whole github ragequit happening.


I'm just seeing these two replies today, but it appears to be back up. Timestamp: ca. 2026-05-03 14:19 UTC


It has a wiki, forum and issues included. So it definitely can do that, what fossil allows by default is to not have a docs/ or bugs/todo file, because its all in the server part.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: