Closed BookOwl closed 7 years ago
And a standard library?
Yep.
Speaking of which, how are libraries going to work in Haumea? I suppose they will be C-like (i.e. separate header file and compiled code) but is there any syntax for function forward-declarations yet?
Speaking of which, how are libraries going to work in Haumea?
I have no clue. :P I've just been making issues for things that I want to add eventually.
I suppose they will be C-like (i.e. separate header file and compiled code) but is there any syntax for function forward-declarations yet?
I don't know and no.
As haumea is a compiled language, I think C-like libraries are a good option, because that also introduces precompiled files for modularized programs, which makes compilation times much much shorter.
The problem, of course, is that the concept is just a little arcane for those new to programming (I, in fact, only really understood the point of C header files a few months ago, when I started programming C seriously)
Maybe haumea could treat all files like header files (that is, read the function prototypes from their defining files), and then use a precompiled binary if one was available? (sort of like an automatic makefile system)
As haumea is a compiled language, I think C-like libraries are a good option, because that also introduces precompiled files for modularized programs, which makes compilation times much much shorter.
I'd say just cache things in /tmp
or something.
import foo /* defines and imports module "foo" [object/dict, will need this datatype] */
import bar as baz /* imports module "bar" but defines it as "baz" */
Also this may need some sort of repository - like npm or Cargo - with a CLI (and perhaps website). We could base it off of GitHub..
# installs https://github.com/nanalan/somemodule.git as module
$ haumea install nanalan/somemodule
$ touch hello.hau
$ echo "import nanalan/somemodule as somemodule" >> hello.hau
$ haumea run hello.hau # bam!
But this is a far-off thing.
I was actually thinking about using use
for importing modules, since it seems a bit more intuitive for non-programmers than import
use math
use foo as bar
As far as a repository goes, we could definitely use Github, at least for the first version. I would like to make a separate repository eventually, since that would make it far easier for users to find packages.
Moving to haumea-lang/thinktank
I would be nice to allow people to write modules in Haumea. This would make the language much more usable for real word stuff and for learning programming in.