<asterite>
I tried mandelbrot and pig from the samples and they work
<asterite>
Now we need: 1. ajax and stay in the same page, 2. codemirror
<asterite>
It would also be cool to optionall get the asm and llvm-ir output
<asterite>
I think the perlin noise sample breaks it
<asterite>
maybe it takes too long without the --release flag
<jhass>
yeah, I shouldn't filter the timeout messages I guess :P
<jhass>
btw you can press n and submit with Ctrl+Enter
<jhass>
and it's just a frontend to the api, POST /run_requests with {"run_request:" {"language": "crystal", "version": "0.7.1", "code": "puts 1"}} ;)
<asterite>
Nice :-)
<asterite>
What did you use for the backend in the end?
<jhass>
crystal ;P
<jhass>
moonshine as "framework" (quickly writing my own router wouldn't have been much more work in retrospect :/)
JBat has quit [Quit: Computer has gone to sleep.]
datanoise has quit [Ping timeout: 255 seconds]
DerisiveLogic has joined #crystal-lang
<asterite>
Yeah... for simple things like this doing HTTP::Server.new and some regex based on the Request is simpler, I think
<asterite>
But cool that you are using Crystal as the backend ;-)
<jhass>
asterite: btw if you want it to respond to run.crystal-lang.org or something, just say so ;)
<asterite>
I'll let waj know, he's the sysadmin :-P
<asterite>
Maybe play.crystal-lang.org, everyone is using "play"...
willlll has joined #crystal-lang
willlll has quit [Client Quit]
willlll has joined #crystal-lang
asterite has quit [Ping timeout: 246 seconds]
datanoise has joined #crystal-lang
willlll has quit [Quit: willlll]
bcardiff has joined #crystal-lang
willlll has joined #crystal-lang
willlll has quit [Client Quit]
bcardiff1 has quit [Ping timeout: 245 seconds]
willlll has joined #crystal-lang
datanoise has quit [Ping timeout: 276 seconds]
willlll has quit [Quit: willlll]
datanoise has joined #crystal-lang
willlll has joined #crystal-lang
shama has joined #crystal-lang
zz_Cidan is now known as Cidan
willlll has quit [Quit: willlll]
Cidan is now known as zz_Cidan
willlll has joined #crystal-lang
zz_Cidan is now known as Cidan
havenwood has quit [Ping timeout: 276 seconds]
asterite has joined #crystal-lang
<asterite>
BlaXpirit: ping
<willlll>
I figured out how to get the API I wanted, single method call with a tuple of types, and a query, and return an array of tupeles so you don’t have to cast afterwards https://github.com/will/crystal-pg/pull/4
<asterite>
willlll: cool! I hope we can improve tuple reflection in the future to make this easier
<willlll>
I think shipping with like 1 to 32 arity out of the box, then letting people add more if they need it in their project
<jhass>
the macro is called only on classes, right? how about adding it only to class Class ?
<willlll>
good call, yeah.
<jhass>
but nice one, indeed
<asterite>
BlaXpirit: well, if you ever read this, there's this project that a friend of mine is doing, https://github.com/asterite/nes.cr , and he tried using crsfml and it crashes. Maybe you can make it work, should be easy, just draw pixels on the screen. You can use main_sdl.cr as a basis (it probably crashes because of a misuse of crsfml, but I don't know)
<asterite>
BlaXpirit: oh, and you should try it with super mario 1 or excite bike, not sure it works with other games yet
<fowl>
Ew so he used SDL1
<fowl>
Oh this is the nes emulator everyone is copying
<asterite>
fowl: what do you mean copying?
<fowl>
Like the same thing exists in go, c, etc, they're ports of ports
<asterite>
I don't know, I saw my friend with documents about the 6502 cpu... I don't think he copied the code from another language
willlll has quit [Quit: willlll]
asterite has quit [Ping timeout: 246 seconds]
<BlaXpirit>
asterite, i don't understand what crashes
<BlaXpirit>
sure i am here, just that people always find that precise time when i go away
bcardiff1 has joined #crystal-lang
bcardiff has quit [Ping timeout: 256 seconds]
asterite has joined #crystal-lang
<asterite>
BlaXpirit: how do I render an image into a window?
<asterite>
I'm using set_pixel on the image, but then I don't know how to copy that into the RenderWindow
<BlaXpirit>
asterite, Image is in RAM, Texture is in GPU
<asterite>
And how to pass the image to the texture?
<asterite>
Oh, update
<asterite>
I was trying to use a sprite instead of a texture
<BlaXpirit>
oh you actually need to replace it with window.draw sprite
<BlaXpirit>
oh you actually need to replace it with window.draw Sprite.new(texture)
<BlaXpirit>
one could bypass the Image by using update with an array of pixels
<asterite>
Cool. The image texture sprite things seems to work, but I get a black screen... but the problem is in another part, not sfml related, I'm doing something wrong
<BlaXpirit>
appears so indeed
<BlaXpirit>
sure seems weird to me to store pixels in columns
<BlaXpirit>
asterite, another thing is, I never see anything written to @shown....
willlll has joined #crystal-lang
<asterite>
There's a line @current, @shown = @shown, @current
<BlaXpirit>
well that was a brain fart. i just ignored that line
<asterite>
but that gave me the clue why it's not working
<asterite>
I still don't know... but I don't know in what condition that swap happens
<BlaXpirit>
but if sdl version works..
<BlaXpirit>
asterite, nes.step duh
<asterite>
Oh, yes... I forgot it in the gist
<asterite>
but even with nes.step it doesn't work :(
<asterite>
I'll try to ask my friend
<BlaXpirit>
but surely it must be something here if sdl works
<BlaXpirit>
ok i'm pretty sure that last_rendered_at part is relevant
<asterite>
Well, finally I got it working, so I don't know why he said it crashes
<BlaXpirit>
asterite, displays the title screen?
<asterite>
Yes :)
<BlaXpirit>
good
<asterite>
And just like in sdl, poll events takes a lot of time. But I don't know if one should poll events in every loop cycle
havenwood has joined #crystal-lang
waterlink has joined #crystal-lang
<BlaXpirit>
asterite, what do you mean it takes a lot of time
<BlaXpirit>
vertical sync limits it to like 60 fps or whatever your display is
<BlaXpirit>
window.display operation blocks according to framerate dictated by the limit or vsync
<BlaXpirit>
and events should be polled during every display frame, not every NES frame
<BlaXpirit>
so basically there should be as many event checks as .display calls
<asterite>
So, every time you draw a frame you also check events?
<BlaXpirit>
asterite, yes
<asterite>
Cool, let me check
<asterite>
Works really nice now :)
<BlaXpirit>
another thing is, SFML can tell you "is a button pressed"
waterlink has quit [Ping timeout: 264 seconds]
<BlaXpirit>
not sure if that's worth adapting the current program to