Author |
Message |
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I've made a lot of progress on the language, even begun working on optimization. There is just a few bugs I would like to work out, and a few instructions I'd like to add, and then I'll put it on the CVS. If everything goes to plan, it's maybe a week away, possibly even less .
In debugging, I've begun work on a standard library, and I tell you: It feels really strange to write lines like
I've also used ket notation for various trinary operations that lack a symbol in standard C. It's just a temporary placeholder grammar until better symbols can be found. Right now, to use the PRM instruction on X and 3, one would write TSH on Y and 20 would be written
It is dangerously ambiguous grammar (X|P>3 has a different meaning from X | P > 3), so I'm 100% certain this will be changed in the near future.
|
29 Jul 2008 15:15 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I just imported it to the tunguska CVS (under the name tunguska_3cc).
It's still got a lot of work to be done (some of the code design is dubious to say the least), but it should work reasonably well. I'll get around to uploading some working c code for it later.
Also, as usual with flex and bison (for some reason, they really don't like my makefiles), you have to compile with the following
"make clean all"
Otherwise, they will complain about missing autogenerated files.
|
12 Aug 2008 07:48 |
|
|
Mac Buster
Retired
Joined: 03 Aug 2003 22:37 Posts: 1474 Location: Moscow
|
Thanks for news! Will try it on weekend
|
12 Aug 2008 12:20 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
The C compiler is actually sort of working. I've made a prompt like in the assembler image. It really doesn't actually do anything, but it does take commands
|
20 Aug 2008 14:27 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Actually, this is really cool, I got it to draw a mandelbrot fractal (in a very slow manner, takes at least a minute to render):
|
21 Aug 2008 05:36 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
This is pretty cool. I added support for arbitrary commutative operators in 3CC. The syntax is as follows:
x = a << OP >> b, where OP is any given number.
It's easiest to enter the instruction in ternary, instead of decimal or nonary, since that makes it possible to put up a truth table and directly see what the operator does without having to do a lot of calculations.
Like, if I wanted to create an AND operator, I would put up a table like this, and then simply enter the correct values:
Now a << COP_AND >> b is the same as a & b.
I may change the syntax to a <[ OP ]> b in the future, if and when I implement trit shifting.
|
23 Aug 2008 11:53 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Array indexing now works like in C. Say you have a pointer p to some type t,
is now equivalent to
|
24 Aug 2008 11:21 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Holy smoke, it's raining features over 3CC today. I just finished implementing structs!
Thus far, the following features are either buggy or lacking:
* Variable initialization.
* Global variables.
* Unions.
* Arrays (they aren't quite treated as pointers, as they should)
|
24 Aug 2008 13:56 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I've been without internet access for the last few days, so there's a whole host of changes to 3cc this time around:
* Late symbol evaluation, this means that variable initialization for primitive types should work now.
* At the very least 20 times faster 12 trit arithmetic!!! (Through new opcodes in tunguska). Clearing the screen with a loop in raster mode now takes a second, instead of ten+.
* Arrays work better (still sort of quirky).
* Static variables work better.
|
27 Aug 2008 04:29 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I haven't had much time to spend programming as of late, but I have made some progress with 3CC. It now handles the interaction between {array,pointer,reference} better.
|
19 Sep 2008 14:47 |
|
|
Mac Buster
Retired
Joined: 03 Aug 2003 22:37 Posts: 1474 Location: Moscow
|
Did you updated public sources ?
|
20 Sep 2008 12:47 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Yeah, it's in the CVS.
|
21 Sep 2008 07:54 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Even though 3CC isn't quite finished, I'm probably going to include it in a release of tunguska pretty soon (matter of weeks?). I'll just have to type up a new chapter in the manual on how to use 3CC.
|
24 Sep 2008 04:48 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22743 Location: Silicon Valley
|
OK, so I will wait until your CVS will be "frozen" for that new version and then I will prepare Windows build and may be MacOS X build for PowerPC...
|
24 Sep 2008 19:00 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I have a few things I want to fix before releasing, but hopefully it won't take that long.
The problems I'm addressing are the following:
* Lack of initializers for global and or non plain-old-data variables. I've gotten most of the architectural changes to support such code done.
* Strange variable management in functions. In regular C, if you recurse back into a function, existing non-static variable values are preserved. But in 3CC, it simply rewrites the same memory location with new values, causing unpredictable behavior. This is because regular x86 C can afford to put variables like this on the stack, but since tunguska has a claustrophobia-inducingly small stack, so it's really hard to motivate squandering that much stack space. I may add something like a 'reentrant' keyword to functions, if more standard-C like behavior is desired.
Also, the SF CVS is down at the moment, they're apparently doing maintenance.
|
30 Sep 2008 10:33 |
|
|