<Groogy>
it depends of course on star alignment or something (i.e the exact coordinates of my translation)
<Groogy>
and the output will spew out to me that the ray is pointing in reverse direction of where I pressed
<FromGitter>
<ArtLinkov> sounds like a naughty minus sign somewhere :)
<Groogy>
Well it happens in that math
<Groogy>
that I put there
<Groogy>
oh rigt!
<Groogy>
eh the screencords.w becomes reversed
<Groogy>
so when it is applied to x, y, z they get reversed
<FromGitter>
<ArtLinkov> I can try to take a look if you want
<Groogy>
yeah will have to do when I get home, forgot to put code on github
<Groogy>
since it was borked
<Groogy>
You online at around 18:00 CET?
<FromGitter>
<ArtLinkov> hmm I might be on the train, send me a link to the code and I'll look at it as soon as I can
<Groogy>
Will do, might be able to solve it though after taking a break from coding today
<FromGitter>
<ArtLinkov> Sure, let me know
t0nyandre is now known as t0nyaway
t0nyaway is now known as t0nyandre
Papierkorb has joined #crystal-lang
duane has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter>
<bararchy> damn, we really need to have somekind of "multi-threading" working, even 1 Thread for event loop and another that handles user spanwed Fibers
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<FromGitter>
<bararchy> Right now creating an engine with API calls feels wierd when you wont get any response until the work is done and the other fiber is freed
<FromGitter>
<picatz> @bararchy I wonder if it's possible ( and sane ) to have a process pool to hand out the work to.
<FromGitter>
<bararchy> It all depends, but then you lose shared memory, so it all comes down to other bottlenecks like IPC etc..
<FromGitter>
<picatz> Though that's obviously a less-fun approach cuz then it's more work. :P
<FromGitter>
<picatz> I guess the bottle neck of communicating through some pipes ( or an API endpoint for the process ) could be better than the bottle neck of a single-thread for some workloads though. Though I've never done this in Crystal.
<FromGitter>
<bararchy> might be an idea, maybe using some messagequeue tech
shalmezad has joined #crystal-lang
heaven31415 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<picatz> Somethings gott'a queue up them messages after-all.
<heaven31415>
how can I see code generated by my macro?
<FromGitter>
<straight-shoota> put `{{ debug }}` before the end of the macro
<heaven31415>
thank you
<FromGitter>
<straight-shoota> or, rather `{% debug %}`
<heaven31415>
it's working, thanks
<FromGitter>
<bararchy> you can also use the crystal tool expend
<heaven31415>
I should pass a source file to it, like so? `crystal tool expand filename.cr`
<FromGitter>
<bararchy> I think so
<FromGitter>
<bararchy> never used it myself
<FromGitter>
<bararchy> never actually needed macros
<heaven31415>
I see, gonna try something else becuase this doesn't work :P
lune is now known as z64
<FromGitter>
<yxhuvud> crystal tool expand -c filename:row:column filename, and potentially a filename that requires any needed stuff at the end
<FromGitter>
<yxhuvud> it is a bit bulky as you can see :)
<heaven31415>
thank you
learod has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<crystal-gh>
[crystal] straight-shoota opened pull request #5869: Add path to UNIXSocket created by UNIXServer (master...jm/fix/unix-server-path) https://git.io/vxEWx
That_Guy_Anon has quit [Ping timeout: 265 seconds]
emilsp has quit [Quit: cya]
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Client Quit]
emilsp has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
pracabor is now known as robacarp
That_Guy_Anon has quit [Remote host closed the connection]
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Client Quit]
<FromGitter>
<picatz> @bararchy While reading about Ruby IPC I found this interesting article that mentioned Unix Sockets as a possible option ( which I didn't know about ) : https://www.sitepoint.com/forking-ipc-ruby-part-ii/
learod has quit [Remote host closed the connection]
<FromGitter>
<bararchy> I think if I only need simple messaging I'll just use IO::Memory as a pipe
learod has joined #crystal-lang
<RX14>
@bararchy if you're serving requests then a worker queue is probably a good option
<FromGitter>
<picatz> 👀 Do you have a small crystal play example or something to show me what that looks like? 🙏
<RX14>
then you have a process for the API that recieves HTTP and thats kept responsive
<RX14>
and the worker processes are only processing largew jobs sequentially
<RX14>
so they don't have to be responsive
<RX14>
@picatz sidekiq
<RX14>
just sidekiq
<RX14>
thats what I mean
<FromGitter>
<picatz> I'm looking for an example of the IO::Memory thing as a pipe to communicate between two processes ( preferably a fork'd one ).
<heaven31415>
how can you pass information between threads?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
flaviodesousa has quit [Ping timeout: 256 seconds]
<FromGitter>
<bararchy> heaven31415 threads can share memory unlike processes , though , in Crystal you shouldn't use Threads , because it will sigfault for any IO operation
<RX14>
you can share memory between processes
<RX14>
although it's more complex
<RX14>
@bararchy JVM will use however much ram you tell it to use
<RX14>
if you tell it it can use 500mb (the default) it will use that
<RX14>
and it will use all of it for more performance
<RX14>
more ram == more performance a lot of the time in the case of GCs
<RX14>
i mean if you had infinite ram you wouldn't need a GC :)
<FromGitter>
<bararchy> So why is Crystal faster and uses less RAM ?
<FromGitter>
<bararchy> How would that work though ?
heaven31415 has quit [Ping timeout: 268 seconds]
duane_ has joined #crystal-lang
<RX14>
@straight-shoota it would be possible - I wouldn't do it
<FromGitter>
<straight-shoota> @bararchy It would define a `LOGGER` constant in every type
duane has quit [Ping timeout: 264 seconds]
<FromGitter>
<straight-shoota> everywhere in type or instance scope, you could just write `LOGGER.log ...` and it would just log with the appropriate namespace
<FromGitter>
<straight-shoota> but I doubt it would be great because it's just too much magic behind the scenes
<FromGitter>
<straight-shoota> I mean in fact it's really very simple, but having a mandatory constant defined with a fixed name is not exactly the greatest thing
<FromGitter>
<straight-shoota> (on every type)
benharri has joined #crystal-lang
<RX14>
lol you can't delete a hardlink while it's open in windows
<RX14>
god damnit windows
<FromGitter>
<bararchy> So "a". info(" black") will produce "a: black" ?
learod has quit [Remote host closed the connection]
<FromGitter>
<straight-shoota> in a simplified way, yes
<FromGitter>
<straight-shoota> depending on the log formatter, obviously
<FromGitter>
<straight-shoota> but the really great power comes from the hiearchy
<FromGitter>
<straight-shoota> it allows you to filter log messages from certain namespaces
heaven31415 has joined #crystal-lang
<FromGitter>
<straight-shoota> for example, set the default log level for `Kemal` to INFO, and for `DB`to WARN.
sz0 has quit [Quit: Connection closed for inactivity]
<crystal-gh>
[crystal] straight-shoota opened pull request #5871: Add server and socket constructors receiving a Socket::Address (master...jm/feature/initialize-socket-server-with-address) https://git.io/vxE50
benharri has joined #crystal-lang
benharri has quit [Client Quit]
benharri has joined #crystal-lang
duane_ has quit [Ping timeout: 276 seconds]
azur_kind has joined #crystal-lang
rohitpaulk has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter>
<bararchy> That's sound really useful, why not add it then ?
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter>
<straight-shoota> I think the stdlib logger should be improved with such a feature, the question is in the details of the API for that
heaven31415 has joined #crystal-lang
t0nyandre is now known as t0nyaway
heaven31415 has quit [Ping timeout: 240 seconds]
That_Guy_Anon has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
heaven31415 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
DTZUZO has quit [Ping timeout: 265 seconds]
<FromGitter>
<mlobl> Quick q. Getting an ```undefined method 'match?' for File:Class``` for ```puts File.match?("abc", "abc")``` in an otherwise empty file and running crystal just on that file. I could use ```File.join``` np and I'm using crystal 0.24.2. Did I have to require something just for that method?
<FromGitter>
<ezrast> I don't think File.match exists; what are you trying to do?
<FromGitter>
<bew> it does in master, not in 0.24.2
<FromGitter>
<bew> so this method will be available in next Crystal release
<FromGitter>
<ezrast> oh, my bad
<FromGitter>
<mlobl> ah okay
<FromGitter>
<mlobl> my b
<FromGitter>
<mlobl> thanks
That_Guy_Anon has joined #crystal-lang
andrewzah has joined #crystal-lang
<FromGitter>
<bararchy> Does file.match matches the name or content of the files ?
<FromGitter>
<bew> just the file name
<FromGitter>
<bew> it's a kind-of-glob matching
<heaven31415>
Hey, is there a prettier way to generate a factorial using macros only? I would love to eliminate this temporary variable along with having this expression in line of code, is this possible? https://gist.github.com/Heaven31415/2a197577cb59a2025ca5e496c6cd13b0
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
Groogy_ has joined #crystal-lang
<Groogy>
@ArtLinkov you here?
<FromGitter>
<straight-shoota> you can do `{{ ((1..count).to_a.join("*")).id }}`
<heaven31415>
ohh
<heaven31415>
that's really good, nice
learod has joined #crystal-lang
azur_kind has quit [Remote host closed the connection]
learod has quit [Remote host closed the connection]
<FromGitter>
<bew> what do you mean be "matching a glob" ? If you want to check if a given filename matches a glob, there is `File.match?` in master
<FromGitter>
<mlobl> yeah, that's what I was going for originally. I was thinking if there was some other preferred way I wouldn't have to compile Crystal again, but if not no worries
<FromGitter>
<mlobl> I'll just build master :)
duane has joined #crystal-lang
<Groogy>
whne you do forall T on a method
<Groogy>
is it possible to tell it to limit it to only Floats?
<Groogy>
def self.project(pos : VectorImp(T, 3), mat : MatrixImp(T, 4, 16)) forall T
<Groogy>
my definition
<FromGitter>
<bew> not yet iirc
That_Guy_Anon has quit [Remote host closed the connection]
<FromGitter>
<bew> there was a suggestion to have `forall T < Something` to restrict it
That_Guy_Anon has joined #crystal-lang
<Groogy>
would be nice, not nessecary
<FromGitter>
<bew> not sure where the dscussion is now
<Groogy>
just makes interface bit clearer
<Groogy>
the math here won't make sense in anything but floats so
<FromGitter>
<bew> 'was also thinking about `forall T in Int | Float` for completeness
rohitpaulk has quit [Ping timeout: 263 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<straight-shoota> @mlobl you don't necessarily need to compile crystal to use code from the stlib
<FromGitter>
<straight-shoota> you could just copy the implementation of File.match and monkey patch it in you code
<FromGitter>
<straight-shoota> when next version is release, you just remove the monkey pacth
rohitpaulk has quit [Ping timeout: 260 seconds]
learod has joined #crystal-lang
<Groogy>
@ArtLinkov I've gotten it to work with translation but now it breaks with rotation ;_;
<Groogy>
Seems like the projection is... inversed or something? Tested with a tiny rotation of 0.1 and I can still get the ray "sort of" right but it is off in the opposite direction
learod has quit [Remote host closed the connection]
learod has joined #crystal-lang
shalmezad has quit [Quit: Leaving]
<heaven31415>
what are you working on Groogy if I may ask?
learod_ has quit [Remote host closed the connection]
learod has quit [Ping timeout: 268 seconds]
learod has joined #crystal-lang
<FromGitter>
<mlobl> @straight-shoota Thanks! I'll keep that in mind for the future. I ended up building from sources and I'm chugging along now
heaven31415 has quit [Ping timeout: 240 seconds]
duane has quit [Ping timeout: 260 seconds]
heaven31415 has joined #crystal-lang
learod has quit [Remote host closed the connection]
heaven31415_ has joined #crystal-lang
learod has joined #crystal-lang
<heaven31415_>
that is awesome Groogy
learod has quit [Remote host closed the connection]
<Groogy>
Thanks!
<heaven31415_>
I have seen you before, you are author of ruby bindings for SFML right?
<Groogy>
yepp
learod has joined #crystal-lang
heaven31415 has quit [Ping timeout: 260 seconds]
learod has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
<heaven31415_>
when I write a simple hello world program like ' puts "hello, world" ', on what is this #puts method called (so IO class object I assume) and can I access it somehow?