<FromGitter>
<jwaldrip> TIL: that crystal binaries are not truly portable. i.e. I cannto build on ubuntu and run on alpine... because of the bohem gc requirement.
<FromGitter>
<jwaldrip> so... with that said, is there an ongoing discussion on bringing a crystal based GC to the language. Making it 100% crystal?
<FromGitter>
<johnjansen> @jwaldrip didnt we have this discussion at code camp?
<FromGitter>
<jwaldrip> Oh we did...
<FromGitter>
<johnjansen> or were you just muttering to yourself ;-)
<FromGitter>
<johnjansen> i was sitting close
<FromGitter>
<jwaldrip> Not sure where we landed on it...
<FromGitter>
<johnjansen> not creepy close
<FromGitter>
<jwaldrip> you were pretty close ;-)
<FromGitter>
<johnjansen> haha
<FromGitter>
<johnjansen> i think it was the standard βwere thinking about itβ line on the GC front, @sdogruyol may remember or @elorest, they have better memories than me
greenbigfrog has joined #crystal-lang
<FromGitter>
<watzon> Wishing I was there π
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
sz0 has joined #crystal-lang
<FromGitter>
<drosehn> @DougEverly thanks for the pointer to your `daemonize.cr`. I'm not currently looking to write any daemons in crystal, but that's something that I'm likely to do. My comments were in response to questions brought up earlier by @watzon . What you have is a good start, and I think having that function available as a shard is better than individual programmers trying to figure it out.
hightower3 has quit [Ping timeout: 240 seconds]
<FromGitter>
<watzon> Anyone know how to take a C macro like this `#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)` and Crystalize it?
<FromGitter>
<elorest> @johnjansen My recollection was weβd like to develop some sort of full crystal replacement similar to what go ended up using. Itβs not really at the top of the priority list right now though.
snsei has quit [Remote host closed the connection]
<FromGitter>
<mgarciaisaia> @watzon why not a regular function? That's just making a number from three different others, right?
<FromGitter>
<watzon> Yeah I just thought of that
<FromGitter>
<watzon> I'm tired and overthinking things lol
<FromGitter>
<jwaldrip> @watzon would you prefer that as part of the build though?
<FromGitter>
<jwaldrip> You can do that with macro syntax pretty easily, i typically have a runner that evals the shard.yml and inserts the version
<FromGitter>
<watzon> Just got my second shard up on GitHub! Still have a bit of work ahead of me, but I have the bindings to `procps-ng` https://github.com/watzon/crystal-procps
Renich_ has joined #crystal-lang
<FromGitter>
<johnjansen> @elorest that was my vague recollection too β¦
<FromGitter>
<jwaldrip> @elorest @johnjansen GC's are not easy... well, not true, gc's are trivial, mallocs are the real pain.
<FromGitter>
<elorest> yep.
<FromGitter>
<jwaldrip> Could just comb though bohem and convert it to crystal
<FromGitter>
<watzon> Better yet, let's just write a C->Crystal transpiler to do the heavy lifting
<FromGitter>
<watzon> Then make all the things Crystal libs
<FromGitter>
<watzon> π
rohitpaulk has quit [Ping timeout: 246 seconds]
greenbigfrog has quit [Remote host closed the connection]
<w-p>
self.bar works but still, only if it the associated variables are initialized
<RX14>
yes
<w-p>
so, defaults can't be calculated.
<RX14>
they can be calculated in the initialize function or in "top-level defaults"
<w-p>
but not via setters
<RX14>
no, it doesn't analyse called functions for whether ivars are set
<RX14>
you must initialise all instance variables before you call the first function in your constructor
<FromGitter>
<bew> RX14 wut it works, I thought one couldn't init variables in other methods from the initializer Oo
<RX14>
you can't
<w-p>
alright. that's fine. now I know. thanks.
<FromGitter>
<bew> oh no i miss-read the example
<RX14>
w-p, the problem is that i think there are certain conditions where if you allow what you want to do, you can break the type system
<RX14>
either that or performance
<w-p>
in this instance I was trying to use a configuration object with some mappings such that i could associate one value with another without knowning some things
DTZUZO_ has joined #crystal-lang
<w-p>
eg: lookup the value of the instance var in a hash where the initialize value is the key - look up that key - set an internal value - etc.
<w-p>
without repeating the setter function body
Ven has joined #crystal-lang
Ven is now known as Guest80852
<RX14>
w-p, yeah i guess it's a pain but iirc there's good reasons behind it
<RX14>
i can't remember exactly what they are however
<w-p>
that's ok. good to know. thanks again.
Guest80852 has quit [Ping timeout: 268 seconds]
Papierko- has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
hightower3 has joined #crystal-lang
olbat[m] has quit [Changing host]
olbat[m] has joined #crystal-lang
olbat[m] has joined #crystal-lang
office_boy has quit [Remote host closed the connection]
office_boy has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest12799
office_boy has quit [Read error: Connection reset by peer]
mark_66 has quit [Read error: Connection reset by peer]
office_boy has joined #crystal-lang
mark_66 has joined #crystal-lang
office_boy has quit [Ping timeout: 248 seconds]
w-p has quit [Ping timeout: 240 seconds]
william_ has joined #crystal-lang
office_boy has joined #crystal-lang
office_boy has quit [Read error: Connection reset by peer]
tdc_ has joined #crystal-lang
william_ has quit [Client Quit]
mark_66 has quit [Remote host closed the connection]
office_boy has joined #crystal-lang
tdc__ has joined #crystal-lang
tdc has quit [Ping timeout: 240 seconds]
tdc_ has quit [Ping timeout: 268 seconds]
office_boy has quit [Ping timeout: 246 seconds]
mark_66 has joined #crystal-lang
office_boy has joined #crystal-lang
office_boy has quit [Read error: Connection reset by peer]
tdc has joined #crystal-lang
tdc__ has quit [Ping timeout: 260 seconds]
office_boy has joined #crystal-lang
office_boy has quit [Read error: Connection reset by peer]
office_boy has joined #crystal-lang
office_boy has quit [Read error: Connection reset by peer]
tdc_ has joined #crystal-lang
office_boy has joined #crystal-lang
tdc has quit [Ping timeout: 268 seconds]
office_boy has quit [Ping timeout: 240 seconds]
office_boy has joined #crystal-lang
tdc__ has joined #crystal-lang
tdc has joined #crystal-lang
w-p has joined #crystal-lang
tdc_ has quit [Ping timeout: 240 seconds]
tdc__ has quit [Ping timeout: 258 seconds]
ephemera__ has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter>
<GetRektByMe> Because stdlib has everything from HTTP to OAuth
<FromGitter>
<Willamin> Are there open gl bindings in the stdlib? I couldn't find them
<FromGitter>
<bew> @Willamin I suggest you try some of them (the most complete ones), and see which fits you best. There is no official libs for opengl
tzekid has quit [Remote host closed the connection]
<FromGitter>
<fridgerator> even here, i'm sure changes have been made that aren't reflected yet
<FromGitter>
<renich> good day, Crystalians
<FromGitter>
<renich> I need help with something: say, you have a JSON::Mapping object and one of the instance variables is nilable or string. How can you test for that? I tried `if my_map.thing.nil_ ...` and it doesn't work
<FromGitter>
<renich> also tried `if my_map.thing` and it doesn't work either.
<FromGitter>
<watzon> Hey @faustinoaq does your crystal vscode extension allow you to set a path for the crystal binary?
Ven`` has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest83286
alibby has quit [Ping timeout: 240 seconds]
<xiljin>
numbers and benchmarks aside, I couldn't be happier with the performance I'm getting from a small kemal app with an sqlite backend .. the fact that it's hardly using any system resources is a nice bonus as well
<Papierkorb>
I think that most crystal code runs much much faster than it has any right to. Not from a ruby POV ("Wow this is fast"), but compared to "fast" languages like C or Rust.
<Papierkorb>
I say this as to get this kind of overall performance, you'd usually have to know much more (As in: C or Rust). You still can go even faster in say C, but for what price? If the GC isn't hitting you, you're probably not going to have real issues ;)
<Papierkorb>
watzon, you can use StringScanner. Not exactly the same, but ..
<oprypin>
C and C++ input functions are completely disjoint from reality. they expect everything to be space separated and treat newlines the same as space?
<Papierkorb>
oprypin: A type-safe version of a scanf like function would be kinda neat.
<oprypin>
pls no percent nonsense
<Papierkorb>
no one said percent-string
<FromGitter>
<watzon> Papierkorb: I agree, a typesafe version would be great
<FromGitter>
<watzon> But how to go about implimenting that, I don't know
<hightower3>
Is there a __something__ which expands into filename or dirname where the current file resides?
<hightower3>
(not __FILE__ which points to a temp location if it's a script)
<oprypin>
we've had this brought up
<FromGitter>
<watzon> Something like `pwd`?
<FromGitter>
<watzon> Or `__DIR__` in Python, or whatever it is
<oprypin>
hightower3, what's the "current file" tho?
<oprypin>
not sure what you mean "if it's a script" and what "current file" there would be in that case
<hightower3>
oprypin, yeah, good question :)
<FromGitter>
<watzon> Got tired of wrapping procps because of it's lack of documentation and because C sucks, so I'm attempting to rewrite it in Crystal
<FromGitter>
<watzon> :D
<FromGitter>
<watzon> Who here knew about all the wonders that the `/proc` directory holds?
<FromGitter>
<watzon> I have, but I've never used it
<Renich[m]>
I just learned of it. It seems interesting. The next IRC. Freenode supports it already
<Renich[m]>
pretty much like gitter
<Renich[m]>
but with end-to-end encryption
<Papierkorb>
end-to-end in a public chat room. yeah.
Renich has quit [Remote host closed the connection]
<oprypin>
so all the disadvantages of IRC in a silly web interface? SeemsGood
Renich has joined #crystal-lang
Renich has quit [Client Quit]
watzon[m] has joined #crystal-lang
<watzon[m]>
Testing it out now
leandrobighetti has joined #crystal-lang
<Papierkorb>
... why does it add a [m] at the end of the nick?
<watzon[m]>
I think it's do differentiate between IRC and Riot
<watzon[m]>
Idk
<Papierkorb>
m(
<watzon[m]>
It stands for matrix I guess
watzon[m] is now known as watzon
<watzon>
Figured it out, it's what riot adds when you haven't identified a nick
<watzon>
Now that I've identified with NickServ I don't have the [m] anymore
Giphy[m] has joined #crystal-lang
leandrobighetti has left #crystal-lang [#crystal-lang]
<hightower3>
Hey, quick one (I'm not seeing a tree from the wood). I have obj with property "x", and I need to access obj.x, but the value "x" is stored in a variable. How do I do that? (E.g. something like obj.get(x))
<hightower3>
obj.get(variable) I mean
<watzon>
`obj[variable]` doesn't work?
<oprypin>
hightower3, you cannot do that, not without perparation for it
<hightower3>
watzon, no, since it's a property
<watzon>
Ahh of course
Guest83286 has quit [Ping timeout: 240 seconds]
<oprypin>
hightower3, it all comes down to making a method with case "x"; return x;
<hightower3>
oprypin, right, just thought about that. Ok, thanks.
<oprypin>
you can automate that but it's not clean
<hightower3>
no need, just have one occurrence
<RX14>
oprypin, if it gets people off gitter i have no problems with matrix lol
<RX14>
at least the bridge is "native"
<watzon>
True that
<watzon>
Not a fan of Gitter? Lol
<RX14>
well its not too bad
<RX14>
but the bridge is a pain
<RX14>
the problem with it is that it's not compatible
<oprypin>
RX14, yeah bot has been absent from this channel for a long time
<RX14>
im sure it was there a bit ago
<oprypin>
RX14, im counting 10-20 days
<FromGitter>
<faustinoaq> Still a lot of work to do with Scry, macros and completion, but at least the extension is good enough to work with Amber and Kemal.
<RX14>
yeah sounds right oprypin
Philpax_ has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]