ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
ur5us_ has joined #crystal-lang
nq has quit [Quit: Leaving]
taupiqueur has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #crystal-lang
<holst> How does the Atom thing work? How can I pass a reference to an Atomic to a spawned code block?
<holst> here the "total" is shown as 0 even after the call, but obviously, I want it to show 4
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 252 seconds]
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
<FromGitter> <asterite> Atomic is a struct so it's passed by value. You need to use a class that holds that atomic, and then it will work.
notzmv has joined #crystal-lang
<FromGitter> <jrei:matrix.org> A pointer can work too, but unsafe
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 240 seconds]
ua_ has quit [Ping timeout: 240 seconds]
jrayhawk has quit [Ping timeout: 240 seconds]
f1reflyylmao is now known as f1refly
jrayhawk has joined #crystal-lang
ua_ has joined #crystal-lang
ua_ has quit [Excess Flood]
ua_ has joined #crystal-lang
Vexatos_ has joined #crystal-lang
Vexatos has quit [Quit: Client Quit]
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
notzmv has quit [Ping timeout: 250 seconds]
sorcus has quit [Ping timeout: 250 seconds]
lanodan has quit [Ping timeout: 250 seconds]
raz has quit [Ping timeout: 250 seconds]
lanodan_ has joined #crystal-lang
notzmv- has joined #crystal-lang
sorcus has joined #crystal-lang
<holst> https://play.crystal-lang.org/#/r/cx2f I am struggling with how to define a method that I can use and where I define my "main" code in a CLI app
<holst> in Python I know about if __name__ == "__main__" or __main__.py
<holst> but I think a FAQ like discussion on this would be great. I might even volonteer to do a cookbook "Crystal Language for Pythonistas" ;-)
<FromGitter> <Blacksmoke16> you'd prob want to use two files
<FromGitter> <Blacksmoke16> one is like the "library" code and the other is the entrypoint to the CLI. I.e. that requires the library code, sets up the option parser logic, etc
<FromGitter> <Blacksmoke16> there are also some shards out there to help with building CLIs if you want to go that route
<holst> makes sense; that would be app/{__init__,app}.py and app/__main__.py to run the app
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/oq/tree/master/src has an example
<holst> Great example thanks
lanodan_ is now known as lanodan
nq has joined #crystal-lang
notzmv- has quit [Ping timeout: 245 seconds]
mookie has quit []
ur5us_ has joined #crystal-lang
notzmv has joined #crystal-lang
sorcus has quit [Quit: WeeChat 3.4]
<FromGitter> <descholar-ceo> Hello here, today is my first day trying out crystal, do we have a tool like *irb* in crystal?
<FromGitter> <descholar-ceo> Thank you, but that seems like it works for someone who's going to install crystal so he needs to be careful while compiling crystal, what about ? I have already installed and compiled crystal, but didn't provide that flag, how can I integrate it now?
<FromGitter> <Blacksmoke16> theres a shard `icr`, but its slightly a hack
<FromGitter> <Blacksmoke16> so will have to wait for proper `crystal i` support, or just leverage a `test.cr` file for now
<FromGitter> <moe:busyloop.net> icr works fine for me, i use it to try out simple expressions almost every day
<FromGitter> <descholar-ceo> how can I install `icr` then?
<FromGitter> <moe:busyloop.net> on osx `brew install crystal-icr`
<FromGitter> <descholar-ceo> I use linux mint
<FromGitter> <moe:busyloop.net> don't know about other os'es
sagax has joined #crystal-lang
wolfshappen has quit [Quit: later]
wolfshappen has joined #crystal-lang
<FromGitter> <descholar-ceo> Thank you
<FromGitter> <descholar-ceo> I have it working for now
<FromGitter> <Blacksmoke16> 👍
sagax has quit [Ping timeout: 256 seconds]
wolfshappen has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> `crystal eval` and `crystal play` are also options
taupiqueur has quit [Quit: taupiqueur]
<holst> postmany v0.3.0 released! ;-)
<holst> Blacksmoke16: thanks for the help, ;-)
<holst> It's possible to use that tool to slam lots of pre-baked API calls to a REST endpoint or to just upload a bunch of files to S3/Azure Blob storage
wolfshappen has joined #crystal-lang
<FromGitter> <Blacksmoke16> holst: https://github.com/cli-tools/postmany#installation
<FromGitter> <Blacksmoke16> btw, the `--production` flag doesn't also include `--release`
ur5us_ has quit [Ping timeout: 252 seconds]
<holst> --production: Runs in release mode. .. the documentation wasn't crystal clear on this, pun intended
<FromGitter> <Blacksmoke16> Just means it doesn't install dev dependencies
<holst> run: shards --production build --release --static
<holst> I was actually including both in the build script, but I will update the README as well
<holst> should I include --no-debug?
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <Blacksmoke16> If you want, would make the binary smaller, but also the strack trace less helpful
raz has joined #crystal-lang
raz has quit [Changing host]
raz has joined #crystal-lang
sorcus has joined #crystal-lang
<holst> I am anyway running strip on it, which isn't a really good idea given how unstable / buggy this is right now
<holst> But I did just put this tool into my integration tests pipeline so I am bound to find a lot of corners (I just found a bug that way)
<FromGitter> <Blacksmoke16> Probably should write some tests too if possible