Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules? #19

Closed
BookOwl opened this issue Nov 2, 2016 · 11 comments
Closed

Modules? #19

BookOwl opened this issue Nov 2, 2016 · 11 comments

Comments

@BookOwl
Copy link
Member

BookOwl commented Nov 2, 2016

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.

@bates64
Copy link
Contributor

bates64 commented Nov 3, 2016

And a standard library?

@BookOwl
Copy link
Member Author

BookOwl commented Nov 3, 2016

Yep.

@TheMonsterFromTheDeep
Copy link

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?

@BookOwl
Copy link
Member Author

BookOwl commented Nov 3, 2016

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.

@TheMonsterFromTheDeep
Copy link

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)

@bates64
Copy link
Contributor

bates64 commented Nov 4, 2016

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.

@bates64
Copy link
Contributor

bates64 commented Nov 4, 2016

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" */

@bates64
Copy link
Contributor

bates64 commented Nov 4, 2016

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.

@bates64 bates64 added the design label Nov 5, 2016
@BookOwl
Copy link
Member Author

BookOwl commented Nov 5, 2016

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

@BookOwl
Copy link
Member Author

BookOwl commented Nov 5, 2016

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.

@BookOwl
Copy link
Member Author

BookOwl commented Nov 8, 2016

Moving to haumea-lang/thinktank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants