|10 points by sacado 4425 days ago | 53 comments|
|I finally did it (even if it took longer than I expected, sorry) : arc2c has been updated. There are many improvements and small corrections, but mainly :|
- characters, annotations and strings were added. They can be compared via 'is and 'isnt (string are compared by value, not by address, as in canonical Arc).
- Strings : Unicode is (obviously) fully supported (hand-made !), you can change characters with sref and concatenate strings with +. They are implemented as an array of long (each long is a codepoint). That is quite heavy : each character typically consumes 8 bytes (a kind of UTF-64) ! But knowing length, accessing a substring or changing a character is O(1), which would be impossible with UTF-8. I will probably change the representation to UTf-32, though. When printed, strings are converted to UTF-8.
- closures are now real first-class objects : they can be printed and asked their type.
- a hand-made GC was developed. It is currently a mark-&-sweep one. It is obviously working (at least it does not seem to free used memory) and performs better than Boehm on the tests I ran (the perfs are better because we know how data is organized). Boehm is still used in some places, however, but will eventually be removed.
- 'def is implemented, as a primitive.
- 'len is implemented and works on lists and strings.
- a few primitives work better than before (they handle more types).
I will now work on hash tables.