Computer Science Canada Yet Another Language to Check Out |
Author: | wtd [ Fri Sep 30, 2005 11:42 pm ] |
Post subject: | Yet Another Language to Check Out |
http://www.opendylan.org/learning.phtml |
Author: | Hikaru79 [ Fri Sep 30, 2005 11:55 pm ] | ||||
Post subject: | |||||
Am I doing something wrong with the compiler here? I took the d2c compiler that Ubuntu has in its repos. I wrote a simple Hello, world:
|
Author: | wtd [ Sat Oct 01, 2005 1:10 am ] | ||
Post subject: | |||
Try writing a less trivial program.
Nearly the same generated executable size. We can fairly safely surmise that the bulk of the Hello world program was boilerplate that ends up in any program. More complex programs may not be expected to grow linearly. |
Author: | Hikaru79 [ Sat Oct 01, 2005 9:32 am ] |
Post subject: | |
Ah, yes, I see. I guess the first 2 megs are just overhead that Dylan creates. |
Author: | wtd [ Sat Oct 01, 2005 11:55 am ] |
Post subject: | |
Keep in mind that the Dylan language does a lot of things that C and even C++ do not. |
Author: | rizzix [ Sat Oct 01, 2005 1:05 pm ] |
Post subject: | |
ah a prototyping language... like Self.. oh well.. they did pick the worst name ever though.. sheesh "dylan". |
Author: | wtd [ Sat Oct 01, 2005 1:18 pm ] |
Post subject: | |
If I may ask... where do you get that it's a prototype-based language? |
Author: | rizzix [ Sat Oct 01, 2005 1:21 pm ] |
Post subject: | |
oh... i blindly assumed that.. hmm considering the "slots" and stuff.. correct me if i'm wrong.. hmm |
Author: | wtd [ Sat Oct 01, 2005 1:25 pm ] |
Post subject: | |
The language is essentially Lisp in a vaguely Wirth-ish syntax. The terminology is taken from CLOS. |
Author: | wtd [ Sun Oct 02, 2005 4:24 am ] | ||||
Post subject: | |||||
A TYS for Dylan. I have the following code:
Now that works quite logically, the way you'd expect. What if I insert the following?
Now the output looks weird. So, how do I still allow that assignment, but disregard any attempt to assign an empty string to either the first or last name? |
Author: | wtd [ Tue Oct 04, 2005 8:19 pm ] | ||||||||||||
Post subject: | |||||||||||||
I'm spoiled by Ruby code like:
Ruby's blocks make all kinds of clever looping schemes possible. So I wanted to write something like this in Dylan. Dylan doesn't have the same mechanism as Ruby, though, and has no built-in loop of this type. I'm out of luck, right? Not quite. I was able to compile this:
So, how was this possible? Well, I had to write a macro.
But, then I realized I might instead want a simpler loop, without the variable.
So I created another syntax rule for the macro.
Then I created a bunch of other variants.
Dylan's macros rock. |
Author: | rizzix [ Tue Oct 04, 2005 9:15 pm ] |
Post subject: | |
seems kinda pointless.. to write all that code for something so simple. |
Author: | wtd [ Tue Oct 04, 2005 9:46 pm ] |
Post subject: | |
It makes the code more expressive. http://www.gwydiondylan.org/books/dpg/db_334.html |