[video=youtube;m24piAB4zGw]http://www.youtube.com/watch?v=m24piAB4zGw&feature=youtu.be[/video]
I missed the gravity simulation fad by several weeks, and my collisions are just a dirty hack(overlapping entities repel each other with twice gravity), but meh.
[QUOTE=Larikang;39081573]I use Ruby.
Not sure what your problem is with newlines, though. I've never gotten an error for an including a newline. It's generally safer to add the newline if you're unsure (that will probably also be more readable).
Parentheses are used just like they are used in math: to clear up ambiguity. If there are ever alternative interpretations due to missing parentheses, add them. The interpreter does have rules where it will yell at you for not including them, but I don't think any Ruby programmer bases their parenthesis use off of them. Remember, however, that Ruby is a really flexible language. If you aren't very familiar with the parser you can easily miss alternative interpretations of a statement without parentheses. When it doubt, add them.[/QUOTE]
To clarify here, what I usually think of as a simple ambiguity example in Ruby is this:
[code]method_1 method_2 arg1, arg2[/code]
Which could be interpreted as a call to method_1 with one argument which is the return value of
[code]method_2(arg1, arg2)[/code]
or a call to method_1 with two arguments
[code]method_2(arg1), arg2[/code]
In this case I would add brackets but only for the call to method_2.
[QUOTE=Darkwater124;39082156]What do you like more for a music player?
[img]http://i.imgur.com/k6a5T.png[/img][/QUOTE]
Combination of both would be awesome. If not, second one.
[QUOTE=Gran PC;39077353]Someone needs to buy ru.by and (not) write tutorials on it.[/QUOTE]
[img]http://i45.tinypic.com/2vam81c.png[/img]
[QUOTE=Chris220;39082617]Combination of both would be awesome. If not, second one.[/QUOTE]
An active pause button would look like it's already paused to me.
Recursive fibonacci with n=40:
[IMG]http://eudoxia0.github.com/Hylas-Lisp/img/fib.jpg[/IMG]
Step it up people.
-snip, wrong thread-
[QUOTE=Eudoxia;39082696]Recursive fibonacci with n=40:
[IMG]http://eudoxia0.github.com/Hylas-Lisp/img/fib.jpg[/IMG]
Step it up people.[/QUOTE]
Assuming you're working out fib(a) b times, what are a and b in this case?
-snip, wrong thread-
[editline]3rd January 2013[/editline]
[QUOTE=Eudoxia;39082696]Recursive fibonacci with n=40:
[IMG]http://eudoxia0.github.com/Hylas-Lisp/img/fib.jpg[/IMG]
Step it up people.[/QUOTE]
Which CL implementation are you using?
[QUOTE=sambooo;39082772]Assuming you're working out fib(a) b times, what are a and b in this case?[/QUOTE]
If you mean the computational complexity, the number of additions you have to do with a given n is (1/sqrt(5))*1.618^(n+1), according to [URL=http://courses.csail.mit.edu/6.01/spring07/lectures/lecture4.pdf]these[/URL] MIT lecture notes.
Which is 165438000 in this case.
[editline]3rd January 2013[/editline]
[QUOTE=HubmaN;39082799]-snip, wrong thread-
[editline]3rd January 2013[/editline]
Which CL implementation are you using?[/QUOTE]
CLISP I think. I know, it's shit, I would've used SBCL but I wasn't on Linux at the time.
[QUOTE=Eudoxia;39082820]If you mean the computational complexity, the number of additions you have to do with a given n is (1/sqrt(5))*1.618^(n+1), according to [URL=http://courses.csail.mit.edu/6.01/spring07/lectures/lecture4.pdf]these[/URL] MIT lecture notes.
Which is 165438000 in this case.
[editline]3rd January 2013[/editline]
CLISP I think. I know, it's shit, I would've used SBCL but I wasn't on Linux at the time.[/QUOTE]
No I mean which term in the fibonacci sequence is your benchmark calculating and how many times is it calculated to result in the time on that graph?
[QUOTE=sambooo;39082835]No I mean which term in the fibonacci sequence is your benchmark calculating and how many times is it calculated to result in the time on that graph?[/QUOTE]
The fortieth.
[QUOTE=Eudoxia;39082820]If you mean the computational complexity, the number of additions you have to do with a given n is (1/sqrt(5))*1.618^(n+1), according to [URL=http://courses.csail.mit.edu/6.01/spring07/lectures/lecture4.pdf]these[/URL] MIT lecture notes.
Which is 165438000 in this case.
[editline]3rd January 2013[/editline]
CLISP I think. I know, it's shit, I would've used SBCL but I wasn't on Linux at the time.[/QUOTE]
It's pretty blah - I think it tosses out type annotations as well.
What does it produce when you #'disassemble it? I'm curious.
[QUOTE=HubmaN;39082846]It's pretty blah - I don't think it even respects type annotations.[/QUOTE]
It doesn't even have a JIT, just a bytecode VM. Very retro.
SBCL took 2.8 seconds without any type annotations.
[CODE]
$cat /proc/cpuinfo | grep "model name"
model name : AMD Athlon(tm) II X3 445 Processor
model name : AMD Athlon(tm) II X3 445 Processor
model name : AMD Athlon(tm) II X3 445 Processor
$cat /proc/meminfo | grep MemTotal
MemTotal: 4061020 kB
[/CODE]
[QUOTE=Eudoxia;39082914]It doesn't even have a JIT, just a bytecode VM. Very retro.
SBCL took 2.8 seconds without any type annotations.
[CODE]
$cat /proc/cpuinfo | grep "model name"
model name : AMD Athlon(tm) II X3 445 Processor
model name : AMD Athlon(tm) II X3 445 Processor
model name : AMD Athlon(tm) II X3 445 Processor
$cat /proc/meminfo | grep MemTotal
MemTotal: 4061020 kB
[/CODE][/QUOTE]
I'd suspected it was just plain interpreting. Now I'm [i]really[/i] curious to see its disassembler output.
[QUOTE=HubmaN;39082955]I'd suspected it was just plain interpreting. Now I'm [i]really[/i] curious to see its disassembler output.[/QUOTE]
[CODE]
Disassembly of function FIB
(CONST 0) = 2
(CONST 1) = -2
1 required argument
0 optional arguments
No rest parameter
No keyword parameters
15 byte-code instructions:
0 L0
0 (LOAD&PUSH 1)
1 (CONST&PUSH 0) ; 2
2 (CALLSR&JMPIF 1 49 L22) ; <
6 (LOAD&DEC&PUSH 1)
8 (JSR&PUSH L0)
10 (CONST&PUSH 1) ; -2
11 (LOAD&PUSH 3)
12 (CALLSR&PUSH 2 55) ; +
15 (JSR&PUSH L0)
17 (CALLSR 2 55) ; +
20 (SKIP&RET 2)
22 L22
22 (LOAD 1)
23 (SKIP&RET 2)
NIL
[/CODE]
[QUOTE=Eudoxia;39082845]The fortieth.[/QUOTE]
And how many times?
[QUOTE=Eudoxia;39082963][CODE]
Disassembly of function FIB
(CONST 0) = 2
(CONST 1) = -2
1 required argument
0 optional arguments
No rest parameter
No keyword parameters
15 byte-code instructions:
0 L0
0 (LOAD&PUSH 1)
1 (CONST&PUSH 0) ; 2
2 (CALLSR&JMPIF 1 49 L22) ; <
6 (LOAD&DEC&PUSH 1)
8 (JSR&PUSH L0)
10 (CONST&PUSH 1) ; -2
11 (LOAD&PUSH 3)
12 (CALLSR&PUSH 2 55) ; +
15 (JSR&PUSH L0)
17 (CALLSR 2 55) ; +
20 (SKIP&RET 2)
22 L22
22 (LOAD 1)
23 (SKIP&RET 2)
NIL
[/CODE][/QUOTE]
Ugh, fused instructions. (At least it does TCO!) I've been looking through the sources of your Lisp and am now pretty damn interested in the LLVM API - if I can't figure out my OpenGL issues, I think I'll do some more PLT.
But one more question and I'll promise I'll stop interrogating you - do you consider eval to be at cross-purposes to the type of efficiency I'm guessing you'll want your Lisp to have?
[QUOTE=HubmaN;39083189]But one more question and I'll promise I'll stop interrogating you - do you consider eval to be at cross-purposes to the type of efficiency I'm guessing you'll want your Lisp to have?[/QUOTE]
Not necessarily, for example, you can compile to native code or LLVM IR and also use the JIT compiler to emulate eval, which is what I'm going to be doing. Basically, there will be some function that will take a string, then pass it to the compiler (LLVM automatically exposes all of your compiler's functions to the JIT'ed program) which will read it, compile the code and execute it, then returning "true".
An alternative function would take an 'expected type', like this:
[CODE](eval long "(fib 40)")[/CODE]
And return the result of reading->compiling->running into that type, which can only be done when you know its type at compile time.
[QUOTE=Darkwater124;39082156]What do you like more for a music player?
[img]http://i.imgur.com/k6a5T.png[/img][/QUOTE]
The first choice is pretty much standard for any media player, so I don't know why anyone would vote otherwise.
the second one should be a mousedown render lmao what are you doing
[QUOTE=sixtyten;39083643]The first choice is pretty much standard for any media player, so I don't know why anyone would vote otherwise.[/QUOTE]
because the pressed down button looks sexy
[QUOTE=sixtyten;39083643]The first choice is pretty much standard for any media player, so I don't know why anyone would vote otherwise.[/QUOTE]
Because IRL music player buttons looks like this? And it looks fancier ;)
[QUOTE=amcfaggot;39083708]the second one should be a mousedown render lmao what are you doing[/QUOTE]
Ever heard about toggle buttons?
[QUOTE=Darkwater124;39083880]Ever heard about toggle buttons?[/QUOTE]
whoa thats deep man, like as deep as a button should be pushed before on a gui it automagically becomes a pause button
so pause posting
[highlight](User was banned for this post ("Being an asshole in WAYWO yet again" - SteveUK))[/highlight]
[QUOTE=amcfaggot;39083896]whoa thats deep man, like as deep as a button should be pushed before on a gui it automagically becomes a pause button
so pause posting[/QUOTE]
what
[QUOTE=Darkwater124;39083880]Ever heard about toggle buttons?[/QUOTE]
A play toggle button is a shitty metaphor.
[editline]3rd January 2013[/editline]
It's not really even a metaphor since you'd be hard pressed to find a real-world example.
The play/pause button isn't worth an entire page.
He had the [IMG]http://www.facepunch.com/fp/ratings/tick.png[/IMG] [IMG]http://www.facepunch.com/fp/ratings/cross.png[/IMG] vote there for a reason.
It's a personal preference thing. Conventional styling aside, your opinion isn't any more correct than anyone else's.
I just added some special characters to my thing, and fixed some newline stuff. I'd say my console emulator is pretty much complete. Hooray!
[img]http://puu.sh/1J82Y[/img]
Maybe I should add a preferences menu with things like this?
Sorry, you need to Log In to post a reply to this thread.