[QUOTE=tanraga;31621932]Writing a script to export, tag and embed album art into my iTunes Library so I can sync it to my new phone.
Not completely perfect.
[editline]9th August 2011[/editline]
and because iTunes is so completely retarded, i had to do this:
[code]URI.unescape(track["Location"]).gsub("file://localhost", "")[/code][/QUOTE]
iTunes? Retarded? Surely you jest!
I added a tiny token stack to allow for a slightly more readable syntax:
[code]
=(x "Hello world");
=(x +(2 ?(x)));
[/code]
The output is the same as before.
So everything is called like a C function now?
[editline]9th August 2011[/editline]
Wait, no
They're called like they're functions but the arguments are separated by whitespace?
The tokenizer splits everything except strings by whitespace, I saw no need to add redundant characters between arguments if the parser is perfectly fine without them. While they aren't necessary, you could still put them in there, they'd just be ignored.
The thing is that there are no operators in this language. Everything that's called is just a symbol that's assigned a function pointer, just before execution:
[cpp]
void loadstd(std::map<std::string, unsigned char> sym, unsigned int *varArray)
{
varArray[sym["+"]] = (unsigned int)add;
varArray[sym["="]] = (unsigned int)equ;
varArray[sym["*"]] = (unsigned int)mul;
varArray[sym["?"]] = (unsigned int)der;
}
[/cpp]
Where equ for example is defined as:
[cpp]
void inline __declspec(naked) equ()
{
__asm
{
pop ecx;
pop eax;
pop ebx;
mov [ebx], eax;
jmp ecx;
}
}
[/cpp]
iTunes is about the worst written mainstream app on Windows today.
It just randomly freezes for no reason at all.
Started using dblinq and it is really nice. Its just a shame that linq wasn't made with more features in mind. It removed 70% of queries from my program. But I still have to use queries for things that you think would have been implemented (creating tables, truncating a table, etc)
[QUOTE=CarlBooth;31623930]iTunes is about the worst written mainstream app on Windows today.
It just randomly freezes for no reason at all.[/QUOTE]
Maybe it's my wrongly installed Steam skin, but my Steam freezes a lot too.
[QUOTE=Overv;31624282]Maybe it's my wrongly installed Steam skin, but my Steam freezes a lot too.[/QUOTE]
Mine freezes up every now and then, but its never crashed which itunes does alot
What ARE you guys talking about? Neither Steam nor iTunes freezes or crashes for me.
[QUOTE=Overv;31624282]Maybe it's my wrongly installed Steam skin, but my Steam freezes a lot too.[/QUOTE]
It normally happens when I close a game and it will lock up for about 3 seconds
[QUOTE=Overv;31624282]Maybe it's my wrongly installed Steam skin, but my Steam freezes a lot too.[/QUOTE]
Steam freezes on OS X for me.
Really high CPU usage and after about 20 lines in chat, it grinds to a halt
[QUOTE=Dr Magnusson;31623276]The tokenizer splits everything except strings by whitespace, I saw no need to add redundant characters between arguments if the parser is perfectly fine without them. While they aren't necessary, you could still put them in there, they'd just be ignored.
The thing is that there are no operators in this language. Everything that's called is just a symbol that's assigned a function pointer, just before execution:
[cpp]
void loadstd(std::map<std::string, unsigned char> sym, unsigned int *varArray)
{
varArray[sym["+"]] = (unsigned int)add;
varArray[sym["="]] = (unsigned int)equ;
varArray[sym["*"]] = (unsigned int)mul;
varArray[sym["?"]] = (unsigned int)der;
}
[/cpp]
Where equ for example is defined as:
[cpp]
void inline __declspec(naked) equ()
{
__asm
{
pop ecx;
pop eax;
pop ebx;
mov [ebx], eax;
jmp ecx;
}
}
[/cpp][/QUOTE]
Currently you seem to be hurtling towards dynamic scoping AND seperate namespaces for fns and vars, and that's worrying.
[editline]9th August 2011[/editline]
[QUOTE=esalaka;31610408]RPN Lisp would be pretty rad too[/QUOTE]
[code]
(set-macro-character #\[
(lambda (stream char)
(reverse (read-delimited-list #\] stream))))
[/code]
Enter in your CL implementation, and use [...].
Wouldn't be much fun, though. Sexp indentation assumes that fns are stashed at the start of every list.
[QUOTE=HubmaN;31624880]Currently you seem to be hurtling towards dynamic scoping AND seperate namespaces for fns and vars, and that's worrying.[/QUOTE]
Neither are true. There is no scoping at all, since variables are declared just before execution. Everything is global.
Both function pointers and variables are stored in the same "varArray" variable currently.
After execution of my previous script, I used this call to get the output value:
[cpp]
printf("x: %s\n", varArray[sym["x"]]);
[/cpp]
[QUOTE=Dr Magnusson;31625188]Neither are true. There is no scoping at all, since variables are declared just before execution. Everything is global.
Both function pointers and variables are stored in the same "varArray" variable currently.
After execution of my previous script, I used this call to get the output value:
[cpp]
printf("x: %s\n", varArray[sym["x"]]);
[/cpp][/QUOTE]
I was wrong about the second - the first is correct, though, since you don't have fenced environments: "With dynamic scope, each identifier has a global stack of bindings."
The system needs an overhaul, no doubt about that, and I'm working on it. I just need to find out an elegant way to do it.
I need to implement variable declarations on the fly, and have the parser translate variables better. But all that also depends on there actually being a scope, which means that I'll have to implement functions, or loops atleast, which is my main priority right now.
The linker/compiler/tokenizer relationship needs to be revamped cause right now it's not very flexible.
[QUOTE=Dr Magnusson;31625297]The system needs an overhaul, no doubt about that, and I'm working on it. I just need to find out an elegant way to do it.
I need to implement variable declarations on the fly, and have the parser translate variables better. But all that also depends on there actually being a scope, which means that I'll have to implement functions, or loops atleast, which is my main priority right now.
The linker/compiler/tokenizer relationship needs to be revamped cause right now it's not very flexible.[/QUOTE]
Always the standard Lispy way of doing things - tagged references, although that means typechecking's done at runtime. You can't dodge the issue with static typechecking without slapping type declarations all over your code, though. I'm not sure what the state of the art of type inference is.
If you're in the mood to re-implement Scheme, go with environments bounded by let declarations. It makes your job a lot more easier. What would make your job even more easier, though, would be just to implement lambda, macros, and then implement let that way.
[editline]9th August 2011[/editline]
And tell people to recurse instead of predefining loop structures. FP Nazi ahoy!
[QUOTE=HubmaN;31625332]Always the standard Lispy way of doing things - tagged references, although that means typechecking's done at runtime. You can't dodge the issue with static typechecking without slapping type declarations all over your code, though. I'm not sure what the state of the art of type inference is.
If you're in the mood to re-implement Scheme, go with environments bounded by let declarations. It makes your job a lot more easier. What would make your job even more easier, though, would be just to implement lambda, macros, and then implement let that way.[/QUOTE]
The problem I have right now is that I have too many ideas for what to add to it. There are so many things I want to include, or atleast support, like calling class functions directly, other variable types, and a billion other things. I really want to rewrite the tokenizer though, and separate operators from variables, so I can start flipping operators and operands in the tokenizer so "10 * 10 * 10" would automatically become "10 10 * 10 *".
[QUOTE=Dr Magnusson;31625453]The problem I have right now is that I have too many ideas for what to add to it. There are so many things I want to include, or atleast support, like calling class functions directly, other variable types, and a billion other things. I really want to rewrite the tokenizer though, and separate operators from variables, so I can start flipping operators and operands in the tokenizer so "10 * 10 * 10" would automatically become "10 10 * 10 *".[/QUOTE]
Do you really want to do type checking in your tokenizer?
If you can get around to doing it, though, write down the semantics of your language and hash them out first. It's painful to incrementally develop a language - I've done it before.
[QUOTE=CarlBooth;31624615]Steam freezes on OS X for me.
Really high CPU usage and after about 20 lines in chat, it grinds to a halt[/QUOTE]I don't think that's happening for everyone. I have a friend on OS X who regularly chats way longer than that with no problems.
[QUOTE=Neo Kabuto;31626079]I don't think that's happening for everyone. I have a friend on OS X who regularly chats way longer than that with no problems.[/QUOTE]
His Mac might have a viru- wait nevermind.
[QUOTE=Downsider;31626489]His Mac might have a viru- wait nevermind.[/QUOTE]
Are you trying to imply that there are no Mac viruses? Heh.
[QUOTE=BlkDucky;31626744]Are you trying to imply that there are no Mac viruses? Heh.[/QUOTE]
I'm trying to satirize that.
I know as well as you do why Windows PC's have more malicious software floating out there, and the only thing that's relevant is population.
[QUOTE=Downsider;31627093]I'm trying to satirize that.
I know as well as you do why Windows PC's have more malicious software floating out there, and the only thing that's relevant is population.[/QUOTE]
Or the fact that none of us have the knowledge required to make a thorough objective assessment of the two OSes in terms of security.
But I derail.
[IMG]http://localhostr.com/files/8uhMtON/capture.png[/IMG]
[IMG]http://localhostr.com/files/ygBsg2s/capture.png[/IMG]
Dat BSP
[IMG]http://localhostr.com/files/ldqy55a/Zombie%20Eat%20Out.png[/IMG]
[IMG]http://localhostr.com/files/jcCCDzE/Zombie%20Eat%20Out.png[/IMG]
Dat 2D Game
Nice art style, did you do it yourself?
Gotten really sick of Lua's syntax and ass-backwards support for object-oriented design.
Switching to AngelScript now; it's exactly what I want out of the box.
[QUOTE=Overv;31630536]Nice art style, did you do it yourself?[/QUOTE]
I'm also writing a tutorial about it but I've been playing to much Fallout: New Vegas lately.
[QUOTE=Downsider;31630927]Gotten really sick of Lua's syntax and ass-backwards support for object-oriented design.
Switching to AngelScript now; it's exactly what I want out of the box.[/QUOTE]
Lua's support for OO design is perfectly fine, it's prototype based, just like ECMAscript and it's derivatives.
Personally, I've been wanting to try Squirrel in one of my applications..
[QUOTE=Quark:;31632181]Personally, I've been wanting to try Squirrel in one of my applications..[/QUOTE]
This was a pretty good article on the different scripting languages [url]http://codeplea.com/game-scripting-languages[/url] but it doesnt seem to open anymore.
In speed it basically was Pawn > GameMonkey > Lua > AngelScript > Squirrel
That said they did say that squirrel was one of the easiest to use, pawn being the hardest.
And other that Lua, squirrel had the most commercial usage (Portal 2 and L4D2 uses it)
Lua seemed to be the most neutral in all fields.
Sorry, you need to Log In to post a reply to this thread.