RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
alex`` has quit [Ping timeout: 256 seconds]
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
TakeYourFreedom has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
pabs has quit [Ping timeout: 255 seconds]
pabs has joined #crystal-lang
DTZUZO has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <bararchy> Oh, how I love OpenSSL errors and how clear they are ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a8120ebd74ee9f50db1d6ff]
snsei has quit [Ping timeout: 256 seconds]
<FromGitter> <aisrael> Is there a way to use `JSON.mapping()` with a custom initializer? I’m gettin `this 'initialize' doesn't explicitly initialize instance variable ‘@foo' of Bar, rendering it nilable`
Totoro has quit [Ping timeout: 248 seconds]
Totoro has joined #crystal-lang
duane has quit [Ping timeout: 255 seconds]
alex`` has joined #crystal-lang
<FromGitter> <bew> well, `JSON.mapping` generate an `initialize` method, if you have additional fields that is not in the json mapping, you can initialize them in the type declaration (e.g: `@foo = some_value`), else it's not possible
<FromGitter> <aisrael> TIL ☝️ Thanks
<FromGitter> <bew> Yeah, I don't think it's possible for more complex ivars, not with tha json mapping macro at least. You can always do without it, but it's a lil' bit longer ˆˆ
HoloIRCUser has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<FromGitter> <aisrael> Can a macro capture a block? :D Am wondering if `JSON.mapping(…) do # custom initialisation code` would work
HoloIRCUser has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> Yes could work, not sure it has been ever suggested 👍
HoloIRCUser has joined #crystal-lang
HoloIRCUser has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <aisrael> How do I get a value from a JSON hash? ⏎ https://carc.in/#/r/3kjd
rohitpaulk has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 248 seconds]
HoloIRCUser has joined #crystal-lang
maattdd has joined #crystal-lang
rohitpaulk has joined #crystal-lang
HoloIRCUser has quit [Ping timeout: 240 seconds]
HoloIRCUser has joined #crystal-lang
HoloIRCUser has quit [Ping timeout: 255 seconds]
maattdd has quit [Ping timeout: 260 seconds]
maattdd has joined #crystal-lang
brycek has quit []
brycek has joined #crystal-lang
<FromGitter> <xfbs> Given a path to a base directory, and a path to a file in that directory, how can I get a relative path from the base directory to the file?
<FromGitter> <xfbs> For example, ⏎ ⏎ ```relative(base: "/usr/bin", file: "/usr/bin/bash") => # "bash"``` [https://gitter.im/crystal-lang/crystal?at=5a817461e217167e2c72feed]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 256 seconds]
HoloIRCUser1 has joined #crystal-lang
HoloIRCUser1 is now known as TakeYourFreedom
rohitpaulk has quit [Ping timeout: 240 seconds]
<lvmbdv> GSoC Organization Announcements today
<lvmbdv> I hope crystal is accepted :)
<FromGitter> <sdogruyol> oh, when?
<lvmbdv> i keep refreshing but nothing yet sdogruyol
<lvmbdv> it's only morning in US :^)
<FromGitter> <sdogruyol> let's hope for the best
maattdd has quit [Ping timeout: 248 seconds]
TakeYourFreedom has quit [Ping timeout: 248 seconds]
bijan_ has joined #crystal-lang
DTZUZO has joined #crystal-lang
maattdd has joined #crystal-lang
rohitpaulk has joined #crystal-lang
maattdd has quit [Ping timeout: 252 seconds]
HoloIRCUser2 has joined #crystal-lang
maattdd has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
maattdd has quit [Ping timeout: 264 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
HoloIRCUser2 has quit [Ping timeout: 248 seconds]
duane has joined #crystal-lang
bijan_ is now known as bijan_awaaaay
TakeYourFreedom has joined #crystal-lang
duane has quit [Ping timeout: 260 seconds]
<FromGitter> <hfabre> Hi guys, i'm new to crystal and i wonder why i keep getting a: `in src/crplat/commands/leave_command.cr:12: undefined method 'remove_user' for Nil (compile-time type is (Crplat::Channel | Nil))`
<FromGitter> <hfabre> any idea of what i'm doing wrong ?
<hightower2> hfabre: crystal determines all possible types for a variable at compile time. When you call some method on an object, that method must exist on all types. In your case, Crystal has identified that your variable can either be Crplat::Channel or Nil, and there is no method "remove_user" defined on Nil
<FromGitter> <hfabre> Yes but i have an explicit `unless @channel.nil?` on the line before, shoud'nt it be sufficient ?
<hightower2> Yes but since this is a property (instance variable) something could change it outside of your code
<hightower2> you should redesign it to be like this:
<hightower2> channel = @channel.not_nil!
<hightower2> channel.remove_user
<hightower2> (i.e. you make a local var, then work on the local var)
<FromGitter> <yxhuvud> I prefer `if channel = @channel` ..
<FromGitter> <hfabre> 😮 didn't know about this thanks !
<hightower2> right, sure... was just giving a general example
<FromGitter> <hfabre> works well thanks :)
bijan_awaaaay is now known as bijan_
<FromGitter> <aisrael> TIL: `var.not_nil!` for unbinding the `| Nil` monad :p
bijan_ is now known as bijan_awaaaay
<FromGitter> <hfabre> I think i should rethink my code so i can avoid nilable instance variable
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
<FromGitter> <aisrael> ☝️ In general, that’s a best practice (in whatever language)
faustinoaq has joined #crystal-lang
rohitpaulk has joined #crystal-lang
A124 has quit [Disconnected by services]
A124 has joined #crystal-lang
TakeYourFreedom has quit [Remote host closed the connection]
TakeYourFreedom has joined #crystal-lang
maattdd has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <hfabre> > **<hightower2>** Yes but since this is a property (instance variable) something could change it outside of your code ⏎ Just to be sure i understand the why, this protection is here to protect against race condition or is there any other case where it could happen ?
<FromGitter> <hfabre> i mean i don't see other situation where it could happen
<FromGitter> <aisrael> Probably a race condition. If you’d gone ⏎ ⏎ ```c = @channel ⏎ unless c.nil? ⏎ c.remove_user(@client)``` ⏎ ⏎ Am guessing the compiler won’t complain [https://gitter.im/crystal-lang/crystal?at=5a819aa9d74ee9f50db4611b]
rohitpaulk has joined #crystal-lang
<FromGitter> <hfabre> yes, using a local var works, i was just wondering why the compiler complain about this (appart to protect against race condition)
hmans has quit []
hmans has joined #crystal-lang
<FromGitter> <aisrael> Still guessing: the compiler isn’t ‘smart’ or exhaustive enough to check *all* methods (incl. those in `include`d modules) for any other (reentrant) code that might modify `@channel`
<FromGitter> <hfabre> hmm you should be right, thanks !
rohitpaulk has quit [Ping timeout: 276 seconds]
<hightower2> right
<FromGitter> <aisrael> Personally, that’s a good enough rationale for like a `final` keyword
mroth has quit []
<FromGitter> <aisrael> (Still personally, and no offense to the core team, but I would’ve preferred if Crystal was immutable by default, with a `var` keyword to indicate otherwise)
mroth has joined #crystal-lang
aemadrid has quit []
rohitpaulk has joined #crystal-lang
aemadrid has joined #crystal-lang
ilovezfs_ has quit []
ilovezfs_ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <faustinoaq> @aisrael Well, you can try https://github.com/maiha/var.cr 😉
<FromGitter> <faustinoaq> Crystal has some inmutable things: CONSTANT, Tuples, Structs, Records and NamedTuples 😄
moei has joined #crystal-lang
bijan_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
TakeYourFreedom has quit [Remote host closed the connection]
duane has joined #crystal-lang
<FromGitter> <MrSorcus> Hi all, how to get size of string to hexadecimal represent? Like `"abcd" => "\x04"`
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
snsei has joined #crystal-lang
bijan_awaaaay has joined #crystal-lang
bijan_awaaaay has quit [Client Quit]
faustinoaq has quit [Ping timeout: 240 seconds]
greengriminal has joined #crystal-lang
faustinoaq has joined #crystal-lang
TakeYourFreedom has joined #crystal-lang
bijan_ has joined #crystal-lang
jwaldrip has quit []
jwaldrip has joined #crystal-lang
faustinoaq has quit [Ping timeout: 264 seconds]
<FromGitter> <asterite> @channel.try &.remove_user
<FromGitter> <asterite> string.size.to_s(16)?
<FromGitter> <MrSorcus> > string.size.to_s(16)? ⏎ ⏎ Returned "4" not "\x04"
greengriminal has quit [Quit: This computer has gone to sleep]
Majost has quit []
Majost has joined #crystal-lang
<FromGitter> <hfabre> @asterite got it thanks
faustinoaq has joined #crystal-lang
<FromGitter> <asterite> Sorcus interpolate with string...
<FromGitter> <asterite> "\\x#{...}"
<FromGitter> <asterite> Not sure what's the use of that
alex`` has quit [Quit: WeeChat 2.0.1]
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] S-YOU opened pull request #5713: Add pointer support on Atomic (WIP) (master...atomic_pointer) https://git.io/vAmK8
<Papierkorb> MrSorcus, "\x04" is only a representation, in memory it really is a byte of 0x04. Do you mean you need the size of that representation? What's your use case?
snsei has quit [Remote host closed the connection]
bijan_ has joined #crystal-lang
alex`` has joined #crystal-lang
<crystal-gh> [crystal] S-YOU closed pull request #5713: Add pointer support on Atomic (WIP) (master...atomic_pointer) https://git.io/vAmK8
<FromGitter> <MrSorcus> > **<Papierkorb>** @MrSorcus, "\x04" is only a representation, in memory it really is a byte of 0x04. Do you mean you need the size of that representation? What's your use case? ⏎ ⏎ `@socket.as(TCPSocket).write("\x05\x01\x00\x03\x10v6.ipv6-test.com\x00\x50".to_slice)` ⏎ This code used in socks proxy. `\x10` - size of address. [https://gitter.im/crystal-lang/crystal?at=5a81c1d1d74ee9f50db56bb9]
greengriminal has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
g3funk has quit [Quit: ZNC - http://znc.in]
duane has quit [Ping timeout: 265 seconds]
codenoid has joined #crystal-lang
rohitpaulk has joined #crystal-lang
bijan_ has quit [Quit: System has gone to sleep. ZZZzzz…]
bijan_ has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <asterite> Maybe you could explain what you want to do instead of what code you want to write
<oprypin> aaand Crystal is NOT part of Summer of Code
<oprypin> /cc lvmbdv, @sdogruyol, @bararchy
Take_Your_Freedo has joined #crystal-lang
<FromGitter> <bararchy> Can't belive reactos is there and we are not
<oprypin> uh k
TakeYourFreedom has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> Yeah @bararchy, some other projects too
<dom96> What I can't believe is that Swift is there
<oprypin> oh .....
<dom96> Like that's a bit ridiculous IMO
<oprypin> yes
maattdd has quit [Ping timeout: 264 seconds]
<FromGitter> <sdogruyol> Lol
greengriminal has joined #crystal-lang
<FromGitter> <sdogruyol> Google sucks
Take_Your_Freedo has quit [Quit: Leaving]
Take_Your_Freedo has joined #crystal-lang
<FromGitter> <elorest> Did anyone to crystal submit for summer of code?
<watzon> Is it possible to do a custom `to_s` method for an enum? Or assign a string value to enum options?
<oprypin> watzon, you can add methods to an enum
<watzon> Oh you can? I didn't knot that
<watzon> know*
flaviodesousa has quit [Ping timeout: 276 seconds]
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
bijan_ is now known as bijan_awaaaay
TakeYourFreedom has joined #crystal-lang
Take_Your_Freedo has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
duane has quit [Ping timeout: 252 seconds]
<FromGitter> <nbw> Hi guys, I'm using Kemal for this programming competition (basically classic snake game with multiple players) and I'm running into issues parsing JSON. I don't have a background with typed languages, which is probably why I'm running into issues. Here's what the a typical post json body looks like: ⏎ ⏎ https://gist.github.com/nbw/31f3873936a43fa297a7a682d9582a11 ⏎ ⏎ Kemal gives you access to the json
<FromGitter> ... post-parsed, for whatever reason. The type is aliased here https://github.com/kemalcr/kemal/blob/master/src/kemal/param_parser.cr, but it's not JSON::Any. ... [https://gitter.im/crystal-lang/crystal?at=5a81e6368c71e5e01d879f23]
<oprypin> looks like json mapping would work nicely for you
duane has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
<oprypin> and that would be `food_obj["data"].as(Array)` , anyway
<FromGitter> <nbw> Yeah, I've considered that as well. What does it look like if you have Arrays of complex hashes? I couldn't find an example. ⏎ ⏎ What would the mapping of: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a81e85118f388e62694ae09]
<oprypin> nbw, you wrote .as(Hash) without any problems, then why do you hesitate about writing .as(Array) ?
<FromGitter> <nbw> I think it asks me for a more specific array type.
<FromGitter> <nbw> as it's not one of the kemal JSONTypes. I'd like to work around Kemal's parser, which you linked to. Reading up on that now
<oprypin> thankfully you were able to open the link cuz the site seems down?
<FromGitter> <nbw> oh, yeah. looks like it. well.. not closing that tab then :D
<oprypin> nbw, yeah i dunno, you can try to go for JSON::Any with the linked workaround
<oprypin> but note that this will all be gone in the next release of Crystal
<FromGitter> <nbw> I mean i run into a similar problem as this guy did where i get an empty string.
<oprypin> only JSON.mapping was good enough not to change
<FromGitter> <nbw> but just trying that gets_to_end again.
<FromGitter> <nbw> which is exactly what he does in kemal's json parser.
<oprypin> nbw, are you trying the exact line that I linked?
<oprypin> also note that you cant use any of that if you've already used .json
<oprypin> cuz it has alreasdy been gotten to end, ya know?
<FromGitter> <nbw> ```code paste, see link``` ⏎ ⏎ unless I'm misunderstanding how i should be inspecting this. [https://gitter.im/crystal-lang/crystal?at=5a81e9ce18f388e62694b7ed]
<FromGitter> <nbw> ohh
<FromGitter> <nbw> sorry, gotta get rid of that 3rd line.
<FromGitter> <nbw> hold the phone. ☎️
<FromGitter> <nbw> That worked. Just make sure not to call Kemal's json first. ⏎ ⏎ For documentation purposes: ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/crystal-lang/crystal?at=5a81eae84a6b0dd32bc0b2c6]
<FromGitter> <codenoid> long time no see
duane has quit [Ping timeout: 276 seconds]
duane has joined #crystal-lang
maattdd has joined #crystal-lang
dragonkh has joined #crystal-lang
<dragonkh> evening
<oprypin> speak of the devil
<dragonkh> the open ssl AES cipher support in Crystal is enforcing a key length of 16 - if I put less than 16 it complains - if I put more than 16 it only takes the first 16 - is there a way to allow the user to put a password of min 8 - and max 20
<dragonkh> https://tio.run/##xZHBSsUwEEX3@Yohqxbeq@hKCi5EXAjKW/QDJCZTDC9NYpJS@vV1GtPShUvBZe7MPZk7I8MckzDLEvBr1AGBO482RnMjtf/EwBkbnBoNwuNzxwAU9hDR9A1aGWafKiWSOIEXMU4uqJpaAH6s8AAXYnXda9s@ZaWxOFVcYDzf3t2f5Yfkx/4NeZSuOBNmo@eKdqS8XNr2DQcX5pVZ9GYKOmFVrKOn0TDPV9e/dvTaCrOXknuPRkukN1rFjlkV/nnWgvzHrCVnzlo2j4q@ozvvx@XDDGLC6AaEFc5PwNcBKQvzHnZbfq3GbVN7hQwHxhaO/MvyDQ
<dragonkh> I'm finding openssl is a bit urrrrgh at the moment
<oprypin> dragonkh, you realize that encrypting passwords is pointless?
<dragonkh> I'm not trying to encrypt the password - just the data
<oprypin> ok
<dragonkh> but I want the user to not be restricted by having to put exactly 16 chars as the password
<oprypin> hash the password, i dunno
<oprypin> that sounds a bit silly but if you insist on that cipher, why not
<dragonkh> its the same will all the ciphers I've tried
<dragonkh> they have a key length hardcoded
<oprypin> dragonkh, so i still say hash the key
<dragonkh> the ruby version allows any size password - and it just uses openssl also
<oprypin> well if ruby is so nice, go check its source code
<dragonkh> I want the data to be decryptable in crystal and javascript - so I don't want to do anything specific to the crystal one to make it different
<dragonkh> the javascript one also allows any size password
<dragonkh> maybe I need to write my own one
<oprypin> dragonkh, can i see proof regarding ruby?
<dragonkh> Cipher64.encrypt("pass", "hello") --> "\x8B8a\xB0\x8A\\\x86\xAE"
<oprypin> dragonkh, this hashes the key................
<dragonkh> where does it hash the key?
<dragonkh> ah you mean the Cipher one
<oprypin> SHA256
<dragonkh> I'll try that
rohitpaulk has quit [Ping timeout: 240 seconds]
codenoid has quit [Quit: i sleep in my keyboard]
jradd has joined #crystal-lang
maattdd has quit [Remote host closed the connection]
pabs has quit [Ping timeout: 256 seconds]
pabs has joined #crystal-lang
maattdd has joined #crystal-lang
duane has quit [Ping timeout: 268 seconds]
<lvmbdv> about gsoc:
<lvmbdv> FUCK
<lvmbdv> i really wanted to get paid to work on crystal :^)
<lvmbdv> now i'll do it for free anyways :)
maattdd has quit [Remote host closed the connection]
TakeYourFreedom has quit [Remote host closed the connection]
<FromGitter> <chuckremes> Crystal wasn’t accepted to GSoC this year?
vivus has joined #crystal-lang
<Papierkorb> Apparently .. Though swift being part of it is kinda ridiculous
<Papierkorb> As if apple couldn't find and pay some by itself
<FromGitter> <chuckremes> Swift? Does Google really need to subsidize Apple now? :)
<FromGitter> <chuckremes> heh
<lvmbdv> this might come in handy for crystal
dragonkh has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
moei has quit [Quit: Leaving...]
duane has joined #crystal-lang
<FromGitter> <bew> Yeah that's what Manas is working on since... quite a long time for crystal, but currently didn't publicly release anything about it :/
maattdd has joined #crystal-lang
<FromGitter> <Wachiwi> Short question I am too inexperienced to solve: ⏎ ⏎ I have the following source code where I want to create a Fiber without the `spawn`-macro. But when I try to run it the result is the error below. Could anybody tell me what I am missing there? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a82242a4a6b0dd32bc20c1a]
<Papierkorb> Why are you trying to get around the spawn macro?
<FromGitter> <bew> note: `f1.yield` doesn't mean anything from where you call it
<FromGitter> <Wachiwi> For university I need to explain concurrency in crystal and I wanted to unterstand it by fooling around and understanding it
<FromGitter> <Wachiwi> @bew thx, good to know
<FromGitter> <bew> it basically mean that from outside the fiber, you're stoping it, but it wasn't even running
<FromGitter> <Wachiwi> @bew so `f1.run` would be the proper call?
<Papierkorb> It 1) creates the fiber (like you did) and then 2) enqueues it into the scheduler, in other words, schedules it to be run at a later time
<FromGitter> <bew> @Wachiwi `just `sleep` or `Fiber.yield` or `Fiber.current.yield` in the main fiber, and the execution will pass to the execution to another fiber
<Papierkorb> Fibers are a bit brittle so you shouldn't (in the regular case) directly interface with them (For production code use channels instead)
<FromGitter> <Wachiwi> thx for the explanations
<Papierkorb> Depends on what you're actually explaining. The architecture? The scheduler? Channels?
<RX14> ok, time to apply for the rust gsoc instead lol
<FromGitter> <Wachiwi> @Papierkorb In general I only need to explain Fibers and Channels and how the help to solve race conditions etc.
<FromGitter> <Wachiwi> So I am trying to break them down and understand them
<Papierkorb> Wachiwi, Crystal employs an extremely similar approach to Go, so if you haven't already, you may have an easier time finding info on Go which basically applies 1:1 to Crystal
<FromGitter> <Wachiwi> thanks for the hint, I will take a look
<FromGitter> <xfbs> What's the difference between `def` and `fun` in crystal? https://github.com/lbguilherme/os-crystal/blob/master/src/x86/loader.cr
<Papierkorb> In short, concurrency (and by extension parallelism) is a hard problem. The hard thing is not starting threads, but synchronization. Traditional means are e.g. Mutexes/Semaphores. As they're hard to get right, other means emerged. Some languages/frameworks used the Actor pattern for that. Other frameworks (e.g. Qt with C++) allowed you to run a single function (later, Lambdas) in a thread parallel to your program, without you having to
<Papierkorb> mess with threads directly - Issue is, this isn't "interactive". You start them and wait for their result. Go (and Crystal) went beyond this by adding channels to add interactivity back
<FromGitter> <CodeTrooperMC> One returns and one doesn't? Just a guess.
<FromGitter> <CodeTrooperMC> @xfbs
<Papierkorb> That's my TL;DR on the history of concurrent computing :P
<RX14> @CodeTrooperMC incorrect
<Papierkorb> xfbs, def is a Crystal method (only visible to Crystal), a `fun` is a C function (visible to Crystal and from the outside). fun's also use the C calling convention, Crystal methods don't guarantee you that
<RX14> ^
<FromGitter> <xfbs> Ohhh gotcha
<RX14> basically don't use `fun` outside of `lib`
<FromGitter> <CodeTrooperMC> Okay. I was guessing though. Is Crystal out for Windows yet?
<RX14> `fun` with body is only useful in a few small places in the stdlib
<RX14> @CodeTrooperMC no
<FromGitter> <xfbs> What are the roadblocks to crystal on windows?
<FromGitter> <bew> also, @xfbs `def` is a Crystal method, you can pass any kind of types in arguments, and return any kind of types too, and `fun` can only use basic primitive types, line Int32, Char*, Pointer, ..
<RX14> @xfbs manpower
<FromGitter> <xfbs> Can I use crystal to write a library that is usable by C? Not that I need to, but like, hey
<FromGitter> <xfbs> Okay manpower trumps haha
<FromGitter> <bew> yes @xfbs
<FromGitter> <bew> kind of
<RX14> no
<RX14> you can't
<Papierkorb> xfbs, No except technically yes https://gist.github.com/Papierkorb/02d6ba53c28b5035a80bf7695f4706bb
<RX14> in practice no
<RX14> why bother telling the truth when it just hurts
<RX14> you can't do anything useful with it so why say so
<Papierkorb> Because there's always the risk of learning something new, even if it's not immediately applicable
<FromGitter> <xfbs> "can't do anything useful" meaning that you can't use large parts of the stdlib because xxx or why is that?
<RX14> GC
<FromGitter> <CodeTrooperMC> Probably dumb question: Is crystal built with whatever standard libraries C has or are there other libraries
<Papierkorb> It's not useful in the general case
<RX14> and
<RX14> the event loop
<RX14> the stdlib assumes it owns the world
<RX14> the stdlib assumes it owns the process
<RX14> and so there's lots of reasons
<FromGitter> <xfbs> Hehe okay I see
bijan_awaaaay is now known as bijan_
<Papierkorb> in more boring terms, global state
<FromGitter> <xfbs> Crystal is implented under the assumption that it's running the shop
bijan_ is now known as bijan_awaaaay
<RX14> Papierkorb, well global state itself isn't the entire reason
bijan_awaaaay is now known as bijan_
<Papierkorb> the entire list of reasons is almost as large as src/string.cr
<RX14> lol