by jadbox · 3y ago · 0 comments
The other part is that Nim's strongly typed and compiles to native code but allows you to do dependent typing like things that lets you be flexible on types:
type
X = object
Y = object
Z = object
NotXY = not (X | Y)
proc doSomething(_: NotXY) = echo "hi!"
edit: I forgot the mention, but NIR is cool and part of an overall initiative to improve the Nim compiler which will hopefully reduce bugs and improve performance. Plus hopefully enable native WASM support which would be handy for GUI stuff!Any plans to develop this into something beyond a hobby project? I think a Qt rival in a language safer and more pleasant than C++ would be welcomed by more than a few people.
At least I personally would like to use it to ship commercial cross-platform apps w/o needing electron or something huge like QT. Nim is much more pleasant than C++! You can actually embed the Nim compiler (~8MB) and run Nim as scripts too, so in theory you could remotely update your app as a nimscript.
P.S. drop me a line (emails on my github profile) if you're interested
In defence of Qt, there's a lot of functionality in there, and they've made it modular.
To my knowledge Qt's library binaries have roughly the same file sizes as, say, their Gtk equivalents. I wouldn't expect a new competitor to be that different.
Like the sibling I'd be very much interested in this! Have you considered open-sourcing the GUI library part?
What do you use for controls, native OS objects or something custom drawn? If the latter, you're in for a word of pain with screen reader compatibility, internationalization, right-to-left languages, handling of Asian input methods etc.
> If the latter, you're in for a word of pain with screen reader compatibility, internationalization, right-to-left languages, handling of Asian input methods etc.
Custom drawn, and yep it's a pain! Actually emoji's seem the hardest (e.g. smiley face + skin tone).
The windowing library I'm building upon uses the OS'es input method editors (IME). For example MacOS'es functions for composing letters like `é` already works. Hopefully Asian input methods will work via the OS'es IME. Luckily I know a bit of (modern) Hebrew, so I'll can add basic RTL languages soon.
(Nim compiles to C, so in fact it compiles to exactly that).
type MyObject[T] = object
val: int
other: TEdit: oh X, Y, Z are singletons I guess? Still don't see the flexibility or dependent types?
https://github.com/saem/vscode-nim#nim-lanugage-server-integ...
That is the fist time I hear this. Other than Python, I always felt Nim is more like Pascal and Ada.
We should be getting back what Xerox PARC was already doing in systems programming with Mesa/Cedar, Interlisp-D and Smalltalk in terms of systems programming.
This is where I see a value in languages like D and Nim, Swift, or even Go, regardless of the opinion on much systems it can be used for.
Back in my day writig compilers, linkers and OS services was considered systems programming.
A small taste,
"Eric Bier demonstrates Cedar"
https://www.computerhistory.org/collections/catalog/10278104...
Full graphics workstation in 1980's, implementated in a systems programming language using reference counting, with a tracing GC as cycle collector, with an object model partially implemented years later as OLE/COM.
(There is a hint on something like that wrt. Mesa/Cedar on wikipedia. FWIW -- I've obviously never used it myself)
Nim's home page acknowledges borrowing from Python, Ada, and Modula, as well as C/C++. I don't think D is part of the mix.
While Nim indeed comes from Wirthian heritage instead of K&R heritage, its goals are pretty similar to D. You could say that Nim is for (Object)Pascal what D is for C(++). I think that's what the GP alluded to - not that Nim borrows directly from D or the other way around.