Comptime. After having discovered Zig, I've been missing that feature in every other language.
Microfeatures I'd like to see in more languages
71–80 of 539 posts
Re: Microfeatures I'd like to see in more languages
#72Comptime. After having discovered Zig, I've been missing that feature in every other language.
Re: Microfeatures I'd like to see in more languages
#73Comptime. After having discovered Zig, I've been missing that feature in every other language.
Sure, comptime is great, but I've also found it hard to reason about code with it. I prefer my comptime stuff separated out into its own section/file/whatever. With that small change, it becomes so much easier.
But yeah, still powerful and nice.
Re: Microfeatures I'd like to see in more languages
#74Earlier quoted context omitted.
How is that third one readable at all? I’d assume it meant integer division.
Mathematica uses a lot of syntactic sugar. You will find all Mathematica code unreadable until you've learned to read it; `//` is no exception.
Its convenient when writing though.
Re: Microfeatures I'd like to see in more languages
#75> Instead of writing 10000500, you can write 10_000_500, or 1_00_00_500 if you’re Indian. I hate this so much. It means I can't grep for a constant.
Re: Microfeatures I'd like to see in more languages
#76Function composition operators eg
a |> b # Call `b` with `a` as an argument
b
Then you can do something like let x : Map = collect map(entries)
|> flattenRe: Microfeatures I'd like to see in more languages
#77Typescript does it well. F# (completely statically typed) too…
Re: Microfeatures I'd like to see in more languages
#78Php supports kebab-case variables: ${"variable-name"}=123; Isnt it beautiful?
How many languages support kebab case with any Unicode dash that isn't the ASCII one? :)
let ``foo-bar–baz—quux`` = 3Re: Microfeatures I'd like to see in more languages
#79Negative array subscripts. So a[-1] means the last element of an array, a[-2] means the second last, and so on.
Re: Microfeatures I'd like to see in more languages
#80Lua also allows you to choose the string delimiter. If your string contains "]]" you can delimit it with [=[ or [==[ instead. Any number of "=" so long as the opening and closing delimiters match.