Normally I would not write about the things of this type, but I figured it is a cool oddness worth mentioning: apparently, on MS Windows you can make the "echo" command not interpret its arguments by appending the dot to it. So, the "echo. /?" outputs the "/?".
Don't rush to blame anyone - because the blog entry itself has an interesting ending - which is one of the reasons I think it was worth mentioning here:
"This is what happens when a language develops not by design but by evolution."
I'd put it a bit in a different way though - "This is what happens when the evolution of the language is not foreseen by the original design". The key thing is to try to not make the flexibility at a price of a complexity. On the other hand, it's amazing what one can do using the free tools out there. I've used the snacc at some point in time - it's a pretty cool beast. Albeit, I must admit that reading up about all those different kinds of seemingly overengineered things is probably a bit daunting. Of course, there's XML and all these newly derived formats...Boo. Too many angle brackets :)
Nonetheless, all of those are just special cases of distorted S-expressions :-) - so designing in terms of those might be actually the best approach.
So, I'll go off to install Lisp, and meantime you can go and read some wizdom.
p.s. Of course, any wizdom is subjective :-) - so don't forget to have other views as well :)
Friday, April 4, 2008
Evolution vs intelligent design..
Posted by
Dalien
at
12:27 AM
0
comments
Labels: coding
Sunday, March 30, 2008
LSL Plus: the Eclipse plugin for LSL
A while ago Tiessa wrote up about the programming environment for LSL.
I've found today a possibly nice addition: LSL Plus, which is an Eclipse plugin. Dubbed as an alpha state (and since I myself do not really use the Eclipse, I did not test it out :) But if you do - give it a shot and see how it works.
On the interesting side - it actually enhances the language with a few interesting features, and cross-compiles into the "canonical LSL" when publishing the scripts to SL.
Posted by
Dalien
at
2:06 PM
0
comments
Return codes or exceptions ?
As promised - no more pics or movies :) Rather, in preparation for your monday, yet another debate on the topic of return codes vs. exceptions. Somewhat like a vi vs. emacs or windows vs. linux :). Personally I am very biased towards vi, linux, and return codes, respectively - but the article (and the comments) gives a good thinking material nonetheless.
Posted by
Dalien
at
12:54 PM
2
comments
Labels: coding
Saturday, January 5, 2008
A language that saves you some typing.
A couple of days ago I was whining to my friend about the mainstream programming languages - they are so *verbose*.
consider even one of the lowest levels, C:
int add_two(int to_what)
{
return 2 + to_what;
}
int main(int argc, char *argv[])
{
int another_two = 2;
int result = add_two(another_two);
printf("Result is %d\n", result);
return 0;
}
Now, how many times do you *really* need to declare the types of things, and how many of them are not really necessary ?
Iet's see. add_two should know that adding two integers is integer - so the declaration of the return type is unnecessary. another_two is assigned 2 - which is integer, so it is integer. add_two is called with this resulting integer - so the declaration of the parameter type there is also redundant. result is assigned the return value from the integer function add_two - so its type declaration is also not needed.
printf, in turn - should not bother to put the "d" into the format string. Iinteger argument should obviously should be printed as integer. main() knows about its arguments from the C library - and we don't use them anyway.
So we could simplify this down to:
add_two to_what : to_what + 2;
main * : another_two = 2,
result = add_two(another_two),
printf("Result is %\n", result),
0;
we got rid of *all* the type declarations - and yet, this description is fully type-strict.
Of course, all the cool stuff has already been done - and the above is quite close to the syntax of OCaml. What is interesting as well - OCaml has quite good performance as well. (Haskell has some similar ideas and is much more powerful - being a lazily evaluated functional language, but is slower).
Of course, being quite an esoteric stuff, google coding with those is much more painful compared to javascript...
(And indeed I should have come up with some less indecent code example, but a bit tired after a 24h low-level hacking marathon with GDB :) Instead I give you a much better link - http://eigenclass.org/hiki/legitimate-microbenchmarks.
A brilliant site all together. very nice read.
Posted by
Dalien
at
11:28 PM
0
comments
Labels: coding
Tuesday, November 6, 2007
Trying out git...
Thanks to Sean Dague for mentioning git on the opensim-dev maillist.
It's been long time I wanted to try it out, but watching Torvalds' video gave it a new kick.
Apparently it is somewhat similar conceptually to some self-written hack I've been using for a while now. So, the hack will now be buried - the funerals will be quick and modest.
I'll write more once I have more impressions.
Posted by
Dalien
at
8:59 PM
0
comments
Thursday, May 17, 2007
rule#2, not quite... (or: Flash and SL)
Ok, after being accused of not following the rule#2, I will need to rehabilitate. Looking back, I think I might not necessarily have progressed on this front all that well in the past day, but at least I did not talk about football, did I ? :-)
Anyway, as it seems like ahead of me I have some exciting evenings in the library studying The Vogue and other useful materials, I need to balance that. So, this post will be about something completely different.
I think first time I heard about flash and SL was when Reuters had made something with it, and in the interview I had read a vague statement that the QuickTime player built into the SL "supports flash". Okay, have to try it out, I said. Of course it is easier said than done. Since the RL is by far not all Flash and Roses, it took me a while to finally get to play with it - RL and other pet projects were furiously competing for my time. Also, since I am approaching this from the perspective of "code" rather than "drag and drop" like any normal person would - life is much more difficult than it could be. (And just in case you did not know - flash player has a full-fledged virtual machine, with it's own flash bytecode. All of this object-drag-and-drop thing is just to ensure normal people can use it too, I think).
So - the first stupid question - "since it is a QuickTime player, how do you embed the flash into QuickTime?". After some (re)search, which did not give the answer to this (incorrectly stated) question, I decide: "well, what if I try to just take a .swf, put it on the server and give it in the parcel video URL?"
Here comes another point. I did see someone ranting on the fact that the SL viewer supports only Flash 5. ("Well, 5 is high enough, no? Could have been version 3?" - the quick look at the flash 8.0 reference quickly made me understand the fundamental mistake. Flash 5 is... well...terse.)
And it looks like everyone but technomasochists, these days code at least in flash7. So, tough luck.. I will have to find something really-really antique to even try my assumption on how to deliver the .swf to the SL clients...
Luckily it was not my first attempt to get a closer look at .swf, and from my previous escapade I had remembered about the existence of Ming - a software library for programmatically generating the .swf files.
So, let's look at ming examples and see if it works... The first attempt brings the "media texture" completely black.. ahh this must be flash8...
Oh! Invaders! Let's try this one... IT WORKS!!
After the first yell of joy, time to calm down. No keyboard events. No mouse events. Well, I *thought* there was something being passed to the script, but not sure - could have been just a side effect of lack of sleep. So - let's assume no keyboard and no mouse...
The lessons learned for now: not quite what I hoped for, but yet still better than changing the colors on the prims. And some folks tend to do interesting stuff even with this limited toolbox. Does anyone know if a model of the Turing Machine already exists in Second Life ?
If yes I think I would make a contest and give a prize to the first person who takes that machine and makes it decode and play mp3s in-world - just to see how far the hackaround skills stretch...
Posted by
Dalien
at
3:32 AM
0
comments
