Page 1 of 3

What would you want in a programming language?

Posted: Fri Mar 07, 2008 8:16 pm
by nekros
Well?

Posted: Fri Mar 07, 2008 8:20 pm
by Zacariaz
That is the age old question that you will never really get an answer to. People are used to various sort of programming languages and naturally when commenting on what they would like, it is colored by what they allready know.
Anyway i know i can't give an honnest answer.

Posted: Fri Mar 07, 2008 9:28 pm
by nekros
Particularly OSDEV.

Posted: Fri Mar 07, 2008 9:49 pm
by Hangin10
Very few semantics about what type IS what. char is really 1 byte. Character should be a class along with String (and the appropriate operators built-in [not overloaded]). default everything unsigned.

And what I wondered lately is why there's never any dynamic allocation on the stack. Like instead of new, just say:

Code: Select all

char* data = stack char[30];
and you just wouldn't be able to delete (as you can't really keep track using just add/sub ESP). Such a thing would really help with doing memory allocation before having an allocator. You'd be able to read in and store the BIOS memory map provided by the bootloader, and then calculate how many bytes are needed for the allocator's bitmap (just put it immediately after the kernel, followed by the descriptor tables, etc) without needing so much more logic in the add-bytes-to-pointer-of-mem-used-past-kernel allocator (at least thats how I've been doing it).

There's probably a lot more, but everyone is going have some odd thing that they'd like to do, like bit indexing (an operator for BSR/BTC/etc instructions) or something. A language can only be so low level before it
stops being portable, unless you don't care about that...

Posted: Sat Mar 08, 2008 12:43 am
by Colonel Kernel
Hangin10 wrote:And what I wondered lately is why there's never any dynamic allocation on the stack. Like instead of new, just say:

Code: Select all

char* data = stack char[30];
It is possible to do this in C99 with variable-length arrays.

For me, I would like a systems programming language that offers more abstractions like closures and iterators (optional of course), more type safety (also optional of course), and a clear delineation between the type-safe world and pointer la-la land. Type inference would also be nice.

Posted: Sat Mar 08, 2008 12:48 am
by Hangin10
Colonel Kernel wrote:variable-length arrays.
Doh. :oops:

Posted: Sat Mar 08, 2008 12:53 am
by DeletedAccount
C# will someday attain everything you mentioned , Please do not start a holy war now, it's just my opinion . I may be wrong. ( You can assume I am wrong!) . The D programming Language from Digital Mars seems to be impressive .

Posted: Sat Mar 08, 2008 1:19 am
by Colonel Kernel
SandeepMathew wrote:C# will someday attain everything you mentioned
It's not bad, but IMO it's too trapped in the Java-esque way of looking at types. That may be ok for small-scale kernel dev, but for the more complex bits I prefer something a bit more dynamic and flexible.

Posted: Sat Mar 08, 2008 8:09 am
by JamesM
Colonel Kernel wrote:
Hangin10 wrote:And what I wondered lately is why there's never any dynamic allocation on the stack. Like instead of new, just say:

Code: Select all

char* data = stack char[30];
It is possible to do this in C99 with variable-length arrays.

For me, I would like a systems programming language that offers more abstractions like closures and iterators (optional of course), more type safety (also optional of course), and a clear delineation between the type-safe world and pointer la-la land. Type inference would also be nice.
Prepare yourself for the UberBeast that is C++0x! I read the wiki page the other day - it will contain closures and iterators builtin, along with a foreach loop. Granted, it uses an absolutely heinous syntax, but it's better than nothing!

Posted: Sat Mar 08, 2008 2:29 pm
by Colonel Kernel
JamesM wrote:Prepare yourself for the UberBeast that is C++0x! I read the wiki page the other day - it will contain closures and iterators builtin, along with a foreach loop. Granted, it uses an absolutely heinous syntax, but it's better than nothing!
Yeah, I know about the feature free-for-all that is C++0x. C++ is already too difficult for most people to figure out -- I don't see how C++0x is going to make it any better. Plus, the type system is still unsafe.

Posted: Sat Mar 08, 2008 2:58 pm
by Alboin
Colonel Kernel wrote:
JamesM wrote:Prepare yourself for the UberBeast that is C++0x! I read the wiki page the other day - it will contain closures and iterators builtin, along with a foreach loop. Granted, it uses an absolutely heinous syntax, but it's better than nothing!
Yeah, I know about the feature free-for-all that is C++0x. C++ is already too difficult for most people to figure out -- I don't see how C++0x is going to make it any better. Plus, the type system is still unsafe.
Agreed. IMO, language 'evolution' is a poor idea that eventually results is mud.

Posted: Sat Mar 08, 2008 3:21 pm
by 01000101
I would want something similar to HLA (High Level Assembly), but not quite as high-level lol. I like the syntax for alot of Intel Assembly language, but I also love the C style IF & FOR macros. I would 100% want direct register manipulation, but with some C-style macros built in.


so basically, I want Assembly, but with a little C-style mixed in.

Posted: Sat Mar 08, 2008 5:59 pm
by SpooK
More cowbell...

Posted: Sat Mar 08, 2008 7:06 pm
by nekros
01000101 wrote:I would want something similar to HLA (High Level Assembly), but not quite as high-level lol. I like the syntax for alot of Intel Assembly language, but I also love the C style IF & FOR macros. I would 100% want direct register manipulation, but with some C-style macros built in.


so basically, I want Assembly, but with a little C-style mixed in.
I always thought that would be awesome. :D I may try doing that after I am satisfied with my OS(Never Gonna Happen :D )

Posted: Sat Mar 08, 2008 7:57 pm
by SpooK
nekros wrote:
01000101 wrote:I would want something similar to HLA (High Level Assembly), but not quite as high-level lol. I like the syntax for alot of Intel Assembly language, but I also love the C style IF & FOR macros. I would 100% want direct register manipulation, but with some C-style macros built in.


so basically, I want Assembly, but with a little C-style mixed in.
I always thought that would be awesome. :D I may try doing that after I am satisfied with my OS(Never Gonna Happen :D )
Such a desired language already exists, it is called C-- :idea: