VoltLang / Volta

Compiler for the Volt Programming Language
151 stars 8 forks source link

Ideas, queries and issues #18

Open ntrel opened 8 years ago

ntrel commented 8 years ago

Hi, Over the years since D2 I've thought about what changes I'd make if starting again. I've written up a list on Google docs, hope that's OK. Not sure if there's another place for discussions.

https://docs.google.com/document/d/10S9357qY0NbCnsKyaefRQvBgmovtv4z_GYyGmcXUU1k/edit?usp=docslist_api

Hope you find it interesting.

ntrel commented 8 years ago

Cleaned up & updated the document, also contains some queries about Volt vs D, feature and minor syntax ideas.

Please let me know if you don't like reading Google docs, I could port it to something else. I realise you probably have your own designs for some of my items - would like to see them :-)

Wallbraker commented 8 years ago

Google docs works, I a bit busy right now so I haven't been able to comment, sorry.

Some quick stuff:

Are some of the quick ones. Some of the changes you can try implementing yourself in the compiler, we are happy to answer questions.

ntrel commented 8 years ago

No problem, I was busy yesterday after posting here :-) Thanks for the reply.

forcing cast(int)boolVar to do math on bools seems iffy

I think bool can implicitly convert to integer, but integer literals 0 and 1 should prefer proper integer overloads including long rather than a bool overload. See: https://issues.dlang.org/show_bug.cgi?id=9999

I might have a look at the source for Volta and maybe implement some minor ideas, I've not tried to work on type system code before but who knows, possibly ;-)

I don't know if we want ctors and dtors for structs

OK, not having dtors might scare some C++ folks, but if we have scope (exit) and macros maybe that's enough, not sure. I appreciate it does make things simpler.

Wallbraker commented 8 years ago

I think bool can implicitly convert to integer, but integer literals 0 and 1 should prefer proper integer overloads including long rather than a bool overload. See: https://issues.dlang.org/show_bug.cgi?id=9999

Oh I see, I tested it and because you can't implicitly convert 0 and 1 to bool the long version is prefered. I don't think we want to implicitly convert 0 and 1 to bools at all so I think we should leave it at that.

Added test cases to our tester, see: VoltLang/Tesla@692e454

I might have a look at the source for Volta and maybe implement some minor ideas, I've not tried to work on type system code before but who knows, possibly ;-)

Even tho this wasn't issue feel free to try it out. Currently it isn't that easy to get started with Volt, but are willing to help out if you want to. We have a getting started guide here: http://www.volt-lang.org/doc/setup/volta.html

I don't know if we want ctors and dtors for structs

OK, not having dtors might scare some C++ folks, but if we have scope (exit) and macros maybe that's enough, not sure. I appreciate it does make things simpler.

I'm not sure myself, it hides whats actually going on where as scope (exit) is more explicit. But having a familiar environment for C++ folks is something good. It needs to be thought about.

ntrel commented 8 years ago

I don't think we want to implicitly convert 0 and 1 to bools at all so I think we should leave it at that. Added test cases to our tester

Great :-)

are willing to help out if you want to. We have a getting started guide

Thanks.