I learned seven programming languages
mode80.github.io
I learned seven programming languages
1–10 of 52 posts
Re: I learned seven programming languages
#2Re: I learned seven programming languages
#3Re: I learned seven programming languages
#4That said: Nim does look nice.
Re: I learned seven programming languages
#5Re: I learned seven programming languages
#6When it comes to safety- or mission-critical software, crashing due to a dangling pointer, a stack overflow or a failed allocation are equally catastrophic, and not crashing but producing a wrong answer due to an algorithmic error is also equally catastrophic. In fact, producing the correct answer late can also be just as catastrophic when the system is real-time -- we don't care if the operation takes 1ms or 99ms, but if the deadline for emitting a control command is at 100ms, emitting it 100.001ms late is just as catastrophic as a crash (while completing the calculation in 20ms or 95ms is equally good). Never crashing for any reason, never producing a wrong result, and never producing a correct result late are all equally critical.
How are such systems written? They normally require very simple code and very simple algorithms -- to make analysis by tools, and even more importantly, by humans as easy as possible. Any compiler magic or implicitness in the code may be problematic (possibly including reference-counting if a bound on deallocation time cannot be guaranteed). We don't want to make code as fast as possible, but as non-surprising and as predictable as possible.
Re: I learned seven programming languages
#7Re: I learned seven programming languages
#8Unfortunately the author only provides the code for nim.
So it is subjective based on a simple practical project (1000 locs). Unfortunately it leaves out all the other "cool kids" like crystal, zig, v, dart, d and so forth...
Re: I learned seven programming languages
#9Re: I learned seven programming languages
#10but then notice later
func icon(forFile fullPath: String) -> NSImage
func icon(forFiles fullPaths: [String]) -> NSImage?
func icon(for contentType: UTType) -> NSImage
func with same name, can have different named parameter, and return type.
func iconForFile
func iconForFiles
func iconForContentType
Will be the alternative in every other language(paramtype overload is available in c*/java/kotlin to extent, but it is less explicit), Swift sounds neat isn't it?
You can see more examples, in particularly class overloads it looks cleaner and convenient to communicate, verbosity is not an issue, code is optimised for reading.
https://developer.apple.com/documentation/appkit/nsapplicati...
The actual issue with Swift, is tooling and there's SOOOOOO many hidden wanted/unwanted "feature"