View previous topic :: View next topic |
Author |
Message |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Nov 30, 2006 11:34 pm Post subject: November 30th -- Cat, reflexive ops, foreach changes |
|
|
I did quite a bit today.
Fixed
- Bug in the interpreter that caused 'nop' instructions (which are really inactive 'jmp' instructions) to jump instead of doing nothing. Statements like "while(true)" were broken because of it (their code wouldn't get run), and now work.
Changed
- Concatenation now works on ranges of values instead of pairs. This has no effect on the behavior or use of the concatenation operators, but improves performance and reduces temporaries created by concatenation. In addition, opCat overloads now take a vararg parameter which holds the list of values to be concatenated with the given object.
- Instruction format changed slightly. The opcode field has been extended into what was the unused attributes field and is now 16 bits wide. There should never be a worry about running out of opcodes ever again.
- Reflexive operations (+=, -=, etc.) now generate better code (thanks to 12 new opcodes) and overloading them now works.
- After working with foreach loops in MiniD for a while, I've come to loathe having to type 'local' for each index. I've deprecated the use of local in foreach; code that uses it will still compile but will issue a warning telling you that 'local' will be illegal in foreach index lists soon, so be sure to remove 'local' from foreach loop index lists.
- Changed the behavior of foreach slightly. If you only specify one index, it will now take on the values returned from the iterator, rather than the indices. This is far more useful. In this way, you can now write:
Code: | foreach(v; [1, 3, 5])
writef(v, " "); |
The output will be "1 3 5" instead of the former "0 1 2".
Moved mdcl.zip from /trunk/downloads to /trunk/minid to make it easier for me to submit it.
Removed the CodeWriter stuff from the compiler. That was there mostly for debugging the syntactic pass; now that I'm pretty confident it works, I don't think I'll be needing it anymore..
Added
- Added array.expand(), which takes an array and returns all of its elements in order. In this way you can "unpack" an array's elements to pass to a function, assign to multiple values etc.
- Added some info on the front page to show where to get MDCL.
Fun fun fun!
For those of you waiting for the ability to save MiniD code to a precompiled binary form: the only reason I didn't implement it today is because if I did, I have no idea how long the format would stay the same. I mean, I just added 12 opcodes and changed the instruction format today; who knows what changes will happen that will make older versions of the binaries incompatible in a few weeks. But I'll probably put them in soon anyway, and I'll put some kind of versioning in them so older incompatible chunks can't be loaded.
I've also been thinking about implementing true default parameters. This would make it illegal to call a function with less than the minimum number of params, and also would make default params somewhat faster as they'd be handled by the runtime and not by script code.
Lastly, if you ever, ever get a message "COMPILER BUG: reversed temp reg indices" when you compile something, let me know and post the code. I hope it never happens, but.. |
|
Back to top |
|
|
ideage
Joined: 12 Jul 2006 Posts: 63 Location: china
|
Posted: Fri Dec 01, 2006 3:03 am Post subject: |
|
|
oh,Build MiniD on DMD0.175 Runtime Error!
Code: | Error: Native table constructor: invalid argument 1 |
error in IOlib create IoTable. lib.fileClass != typeof(MDClass) in DMD0.175
________
og kush
Last edited by ideage on Wed Feb 02, 2011 5:03 pm; edited 1 time in total |
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Fri Dec 01, 2006 9:19 am Post subject: |
|
|
Oops! I thought I had updated to 0.175 already, but I was still on 0.174.. Thanks for catching that error (and exactly where it happened)!
I fixed it by making the MDTable (and MDArray) constructor a little more robust when it comes to class types. I'll now perform an "upcast" to try to cast it to MDObject.
Ah, it's this bug that was fixed in 0.175 that changed it. When I fixed the code, I wondered how it ever worked before.. |
|
Back to top |
|
|
ideage
Joined: 12 Jul 2006 Posts: 63 Location: china
|
Posted: Fri Dec 01, 2006 9:10 pm Post subject: |
|
|
ah,Thanks you!I am a MiniD fans Now!
do you think add PerformanceCounter to baseLib? I consider it is a good future.
________
BMW M06 history |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|