What would you want in a programming language?
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.
Anyway i know i can't give an honnest answer.
This was supposed to be a cool signature...
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:
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...
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];
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...
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
It is possible to do this in C99 with variable-length arrays.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];
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.
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
Doh.Colonel Kernel wrote:variable-length arrays.
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
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.SandeepMathew wrote:C# will someday attain everything you mentioned
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
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!Colonel Kernel wrote:It is possible to do this in C99 with variable-length arrays.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];
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.
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
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.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!
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
Agreed. IMO, language 'evolution' is a poor idea that eventually results is mud.Colonel Kernel wrote: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.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!
C8H10N4O2 | #446691 | Trust the nodes.
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.
so basically, I want Assembly, but with a little C-style mixed in.
Website: https://joscor.com
I always thought that would be awesome. I may try doing that after I am satisfied with my OS(Never Gonna Happen )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.
Such a desired language already exists, it is called C--nekros wrote:I always thought that would be awesome. I may try doing that after I am satisfied with my OS(Never Gonna Happen )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.