3 ms·
As usual, simplicity of this type basically means making the programmer write the boilerplate that the compiler could generate for you. The complexity has to li
by simiones 4y ago
As usual, simplicity of this type basically means making the programmer write the boilerplate that the compiler could generate for you. The complexity has to live somewhere, and with "simple" languages, it lives inside your own source code, and that of each of your libraries, instead of living inside the compiler.
I'm not sure why this appeals to so many people, but still: it clearly does. So, best of luck to the Gleam team, I hope it lives up to your needs and desires!
- theamk 4y agoThis heavily reminds me of old Microsoft's COM's QueryInterface approach, which acted basically the same: interfaces/traits were types. Your code would be like: CDisplayInterface* louis = NULL; HRESULT hr = friend.Friend("Louis")->QueryInterface(CLSID_DISPLAYINTERFACE, &louis) CheckError(hr) io.println(louis->format(DisplayOptions(...))) basically the same thing as Gleam does, but more verbose and without all that safety. (I think anyone advocating "going back to basics" would benefit from actually going back to basics and spending some time on those systems. I hope I will never have to touch COM in my life again, but my experience working with it was very helpful. GLib/GObject and Linux VFS are other class-like technologies which are worth experimenting with)
- giraffe_lady 4y agoEh this isn't lua. It has pattern matching and a sophisticated type system, that's a powerful base that can get you very far.
- simiones 4y agoStill, no traits means no runtime dispatch, which is a pretty big convenience feature that neither pattern matching nor a sophisticated type system help with.