Add polymorphism. I can't see any reason this isn't doable outside of function naming. That's fixable.
"Simple" "templates" based on structure aggregation to make workable generics (list/tree/map etc)
Clean vector math support (like OGLES)
Friday, 6 May 2016
Thursday, 5 May 2016
Fixing C 3
The embedded guys would, really, like you to standardise the bit shift operations and add rotations will you are there, no... seriously!
Wednesday, 4 May 2016
Fixing C 2
Following on from the previous post.
Something I've always fancied to help handle error cases is for/else and while/else
for (int x = start_value; x > 0; --x) {
do_some_work(x,y);
} else {
dont_do_some_work();
}
... and the same for while loops.
You see, the loop construct has to test the initial condition before retesting when the loop loops around. It would not be hard to add an "else" clause e.g. if the loop is never executed then please do this.
It would save the coder writing an additional "if" test and can trivially be used to catch errors e.g. what do you do (or not do) in the above case if start_value is 0.
Something I've always fancied to help handle error cases is for/else and while/else
for (int x = start_value; x > 0; --x) {
do_some_work(x,y);
} else {
dont_do_some_work();
}
... and the same for while loops.
You see, the loop construct has to test the initial condition before retesting when the loop loops around. It would not be hard to add an "else" clause e.g. if the loop is never executed then please do this.
It would save the coder writing an additional "if" test and can trivially be used to catch errors e.g. what do you do (or not do) in the above case if start_value is 0.
"Fixing C"
There's an interesting debates going on at embedded.com and eetimes.com about Fixing C
There's a lot of debate about removing brackets, semi-colons, using pythonesque tabbing etc but a lot of this is probably "syntactic sugar" that will lead to further unexpected problems.
On that note (syntactic) one of the few changes I would make would be the removal of the "single line statement"
if (something > something_else)
a_single_line_statement(something_else);
WHY?!
Because it leads to hell! It is FAR too easy to see someone plug a line of code in and have everything go wrong. Especially when debugging and a printk/printf/debug() line is added.
It is not so hard to use {} to delimit that and the rule about "what is a code block" becomes crystal clear.
I'd apply the same rule to empty code blocks
for(unsigned x = 0; some_array[x]--; x += some_array[x]) ;
Why not just write {} instead of ;
Now, let's not get into why the structure notation uses the same braces as code blocks. But the answer is... there's only so many braces and C uses them all (and C++ augments them with <>!)
But - what else is there?
Proper bounds checking, user defined literals (notably for strings with length instead of null termination), rotate operators and more besides.
There's a lot of debate about removing brackets, semi-colons, using pythonesque tabbing etc but a lot of this is probably "syntactic sugar" that will lead to further unexpected problems.
On that note (syntactic) one of the few changes I would make would be the removal of the "single line statement"
if (something > something_else)
a_single_line_statement(something_else);
WHY?!
Because it leads to hell! It is FAR too easy to see someone plug a line of code in and have everything go wrong. Especially when debugging and a printk/printf/debug() line is added.
It is not so hard to use {} to delimit that and the rule about "what is a code block" becomes crystal clear.
I'd apply the same rule to empty code blocks
for(unsigned x = 0; some_array[x]--; x += some_array[x]) ;
Why not just write {} instead of ;
Now, let's not get into why the structure notation uses the same braces as code blocks. But the answer is... there's only so many braces and C uses them all (and C++ augments them with <>!)
But - what else is there?
Proper bounds checking, user defined literals (notably for strings with length instead of null termination), rotate operators and more besides.
Monday, 18 April 2016
Sunday, 21 July 2013
Dear Susie Wolff
Yes! You prove it! Good pace in the young drivers test. **** all them haters! If you don't do it don't worry too much. I'm already training my 10 month old daughter to be a future F1 champ!!!!
Monday, 15 October 2012
Dear Apple
Mac Book Air 13" + Retina Display + 16 GB RAM + Lots and lots of SSD goodness == $my_money
Thursday, 29 March 2012
PS4, PC,XBOX720, Wii, locked phones
I've had it TBH. The more powerful technology becomes the more "they" want to lock it down.
I'm not even happy with the GPL.
Where's "Anarchy OS" on "Open Hardware"?
*me wants*
I'm not even happy with the GPL.
Where's "Anarchy OS" on "Open Hardware"?
*me wants*
Thursday, 8 March 2012
Sunday, 4 March 2012
SPAM
I wonder when the interwebz will actually be spammed to death? Searching blogs gives endless "stream of consciousness" posts from spam bots and cyberspambots from all over the world. Every word is being parameterised. The bucket of top hits is overflowing. Sometimes I'm just a tiny speck of data in an ocean of noise.
Wednesday, 22 February 2012
ZEDEX
What would you want from a good emulator today?
Z80 emulation... Good Z80 emulation. TBH, really good emulation starts with the bus and works inwards
ULA emulation + those extra bits that get used all over - well, some of them anyway.
We'd want ROM and RAM chip select decode and full I,R,RFSH cycle decoding/interpreting or the system just wouldn't work.
TV emulation - emulate interlacing effects and much more (pixel blur, even warping)
Ear and Mic sockets need good emulation too (I want sound damnit)
Back when this machine came out there were TINY ROM cartridges and everything else came on tape (it was very cheap). If you wanted fast and big back then you could've used floppy discs or very small amounts of Flash (4K). Painful.
Software, well, a decent multi-pass disassembler in the "IDE" would be perfect as would be the ability to load up pre-built RAM/ROM images and give them a go.
A built in assembler would be essential although wouldn't give you that authentic feel! We'd supply an assembler on ROM (additional 8K ROM). TBH, It's the only way to go - A really good cartridge would have additional RAM so we could leave main memory untouched... Can we run the screen from an address < 16384? (my feeling is "NO")
Memory watch windows with some reconfigurability for weird floating point types.
The ability to follow a 16 bit value as an absolute of relative address would be nice too.
You see, there's SO much to do!
Lastly, I'd like to be able to use the emulated machine font for the GUI. Now... that's hard!
Z80 emulation... Good Z80 emulation. TBH, really good emulation starts with the bus and works inwards
ULA emulation + those extra bits that get used all over - well, some of them anyway.
We'd want ROM and RAM chip select decode and full I,R,RFSH cycle decoding/interpreting or the system just wouldn't work.
TV emulation - emulate interlacing effects and much more (pixel blur, even warping)
Ear and Mic sockets need good emulation too (I want sound damnit)
Back when this machine came out there were TINY ROM cartridges and everything else came on tape (it was very cheap). If you wanted fast and big back then you could've used floppy discs or very small amounts of Flash (4K). Painful.
Software, well, a decent multi-pass disassembler in the "IDE" would be perfect as would be the ability to load up pre-built RAM/ROM images and give them a go.
A built in assembler would be essential although wouldn't give you that authentic feel! We'd supply an assembler on ROM (additional 8K ROM). TBH, It's the only way to go - A really good cartridge would have additional RAM so we could leave main memory untouched... Can we run the screen from an address < 16384? (my feeling is "NO")
Memory watch windows with some reconfigurability for weird floating point types.
The ability to follow a 16 bit value as an absolute of relative address would be nice too.
You see, there's SO much to do!
Lastly, I'd like to be able to use the emulated machine font for the GUI. Now... that's hard!
Monday, 6 February 2012
Old Technology
There's lots of fans out there... Black and white moves, vinyl, wax cylinder, 8 bit graphics (sprites, not many colours, colour clash etc) even VHS.
Why is this? Will there be Blu-ray fan groups in the not so distant future? 44.1Khz "heads" who will painstakingly resample all their new ultra-hd-mp7s into CD quality?
Probably not!
But why the love old tech? SNES, ZX Spectrum, Pong, VCS2600, N64 and Playstation even?
I reckon it's their "other-worldliness".
They can't/don't attempt to mimic reality but paint a cartoon, an abstraction of it instead. It's all they could do!
That's what draws people to them. They look like the future, from the near past.
Why is this? Will there be Blu-ray fan groups in the not so distant future? 44.1Khz "heads" who will painstakingly resample all their new ultra-hd-mp7s into CD quality?
Probably not!
But why the love old tech? SNES, ZX Spectrum, Pong, VCS2600, N64 and Playstation even?
I reckon it's their "other-worldliness".
They can't/don't attempt to mimic reality but paint a cartoon, an abstraction of it instead. It's all they could do!
That's what draws people to them. They look like the future, from the near past.
Sunday, 6 November 2011
W00T!!!!
"Thank you. Your request has been sent to our customer service team and we'll get back to you by email in the next 28 days with details of what you need to do next."
Hello O2? This is the internet speaking? TWENTY EIGHT DAYS?
Crickey.
Hello O2? This is the internet speaking? TWENTY EIGHT DAYS?
Crickey.
Thursday, 13 October 2011
Wednesday, 12 October 2011
Blackberry
I ♥ my Blackberry. I like its little keyboard. I like the way all the messaging and contacts just fits together.
But you've broken it! In a really annoying way.
Or to put it another way - I stuck with Blackberry because I like their product - their product includes email!
So... I think you need to be careful. When I started with my crackberry there wasn't much competition. Now we have Android phones (some with keyboards), iPhone, WP7 phones and a lot more besides.
From now on you'll have to persuade me to stay. My dis is a bit gruntled.
Sorry
But you've broken it! In a really annoying way.
Or to put it another way - I stuck with Blackberry because I like their product - their product includes email!
So... I think you need to be careful. When I started with my crackberry there wasn't much competition. Now we have Android phones (some with keyboards), iPhone, WP7 phones and a lot more besides.
From now on you'll have to persuade me to stay. My dis is a bit gruntled.
Sorry
Monday, 10 October 2011
The Internet...
It's hard to tell if people out there are... A - stupid, B - ignorant, C - Cognitively Dissonant, D - Insane, E - Trolls or F - Cunts.
SNR... less than a fraction of decibel...
SNR... less than a fraction of decibel...
Wednesday, 5 October 2011
Good Night Mr Jobs.
Best damn computer I've ever bought.
I know I paid extra for it... but I'm still glad! 3 years and I've never had a system crash. Once the mail app got stuck - it was such a rare event it's still stuck in my mind.
Without Apple, The Steves and all the great engineers they got to build something different the world of computers would be a lot duller, less colourful and generally a bit more... hmmm... Microsoft!
I know I paid extra for it... but I'm still glad! 3 years and I've never had a system crash. Once the mail app got stuck - it was such a rare event it's still stuck in my mind.
Without Apple, The Steves and all the great engineers they got to build something different the world of computers would be a lot duller, less colourful and generally a bit more... hmmm... Microsoft!
Tuesday, 19 April 2011
C as a Systems Language
The "Systems Language" definition is a bit fuzzy. I'd say it has to have address manipulation, type coercion (not conversion but all that evil stuff with unions and the like). It should also support plenty of bit meddling operations and structures.
To this end C has served well.
What has not served well has been the standard libraries and it's evolution.
Huge amounts of the specification can no longer change due to backwards compatibility. For example, we really don't need both typedefs and structs. We really could use polymorphism and even templates (without classes). We could build an object system (ala QObject or Objective C) if we had a slightly better macro system. The typedef synonym system really doesn't work well with automatic type conversion (which should be banned!). The string format is a bit... hmmm... It WOULD be FAR more efficient to store length (I really can't over-emphasize that!)
We could... but it works.
Maybe there's a need for a "new" C... but maybe what we've got is just damn good enough.
I say this as I just been rolling a new first fit and buddy memory allocator - it would be nice to have ref counted objects but, you know what, we can still work without them.
Monday, 18 April 2011
Flow... Explicit vs Implicit
Our computer programs are generally written with the idea that data processing runs from the top of the app the the bottom and may loop round again. Whole programs are written by putting lots and lots of these pieces together.
EDGE programs may be written the same way and re-interpreted to make a graph like system or vice versa - in fact we can translate between representations (compilation and optimisation patterns often use SSA - Single Strategic Assignment - which is a lot like a simple graph).
My code will look a lot more like EDGE than, say, C. This seems a good way to represent a program pre-compilation and for use in a graphical environment.
Subscribe to:
Posts (Atom)