RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
non-aristotelian has quit [Quit: non-aristotelian]
marmotini_ has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 2.2]
Heaven31415 has quit [Quit: Leaving]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
wontruefree has joined #crystal-lang
marmotini_ has quit [Ping timeout: 250 seconds]
wontruefree has quit [Quit: bye]
rohitpaulk has joined #crystal-lang
<FromGitter> <Blacksmoke16> anyone know if its possible to add custom decoders to the mysql/sqlite db adapter shards? Similar to how you can do for the pg shard?
<FromGitter> <markrjr> @straight-shoota I'm working on porting the standard library to windows, specifically the system module. I started with the cpu count function. I've written a couple of files here (https://github.com/markrjr/crystal/blob/886fd269c72b421ec4a69b68ea03da89f17af7b6/src/lib_c/x86_64-windows-msvc/c/ntsysteminfo.cr) and here (https://github.com/markrjr/crystal/blob/886fd269c72b42
<FromGitter> ... 1ec4a69b68ea03da89f17af7b6/src/crystal/system/win32/cpu_count.cr).
<FromGitter> <markrjr> Probably a stupid question, but how exactly do I test/run this?
<FromGitter> <markrjr> Do I compile a version of the compiler for windows and then write a small program that calls that function from the standard library?
<FromGitter> <markrjr> Is there a quicker way?
rohitpaulk has quit [Ping timeout: 252 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <aboeglin> jokke ? You use ssl as well ?
DTZUZO_ has quit [Ping timeout: 250 seconds]
<FromGitter> <aboeglin> the proposed solution didn't seem to work for me ..
<jokke> aboeglin: yeah... For me neither :(
return0e has joined #crystal-lang
<jokke> I use ssl but it's terminated by the reverse proxy
<FromGitter> <dejonjulius_gitlab> hello world
<FromGitter> <proyb6> @bew I’m curious how does stringview look like?
<FromGitter> <bew> @proyb6 you can read about the concept of string view here: https://stackoverflow.com/questions/20803826/what-is-string-view
<jokke> aboeglin: i'm now trying to access the db via `tasks.db` instead of `db` which apparently uses DNSRR instead of VIP and for some people fixes the problem...
<jokke> let's see in about an hour
<jokke> super annoying to debug
<FromGitter> <proyb6> @bew Cool idea, it’s something very useful
<jokke> aboeglin: so far it's working
<jokke> time will tell
ashirase has quit [Ping timeout: 245 seconds]
ashirase has joined #crystal-lang
helaan has joined #crystal-lang
<helaan> Update on my issue from a few days ago: I got a crosscompiler working, didn't manage to crosscompile the compiler, tried my small Kemal app first.
<helaan> App works fine, until it needs to send a POST requests, then it crashes with "Invalid memory access (signal 7) at address 0x74a220dc". Stacktrace is not very informative, which flags can I use to get more info?
<helaan> Currently I have two test programs: One that just calls HTTP::Client.post which works on arm and ad644, the second one wraps it in a Kemal route which works on amd64 but crashes on arm.
<FromGitter> <aboeglin> @jokke Do you have a link to a document speaking about that ?
<FromGitter> <aboeglin> And could you tell me what you changed exactly ?
<FromGitter> <aboeglin> i couldn't find any info about `tasks.db`
<FromGitter> <j8r> Does incremental compilation requires a Nim/Python approach: files == modules? If yes, this might be done for specs - most people already do `moduletotest_spec.cr`
<FromGitter> <j8r> I was thinking about this when I saw the results in the CircleCI console for Crystal
<FromGitter> <straight-shoota> @j8r This approach doesn't work when you can reopen types
<FromGitter> <straight-shoota> @markrjr You can cross compile for windows from any supported compiler platform. The compiler will build all the object files and spit out a linker command that you need to run on windows directly. But you don't need to run the compiler itself on windows (currently it doesn't even compile anyway).
<FromGitter> <fusillicode_twitter> guys I have a strange problem
<FromGitter> <fusillicode_twitter> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc712e5e65a634336f0eb9f]
<FromGitter> <straight-shoota> @markrjr You will only need Visual Studio Build tools and a few libraries on your Windows system. The process is explained with much detail on https://github.com/crystal-lang/crystal/wiki/Porting-to-Windows
<FromGitter> <fusillicode_twitter> `can't cast Hash(Symbol, NoReturn) to Hash(Symbol, Hash(Symbol, String))`
<FromGitter> <straight-shoota> @fusillicode_twitter That's some really weird data structures you've got there.
<FromGitter> <fusillicode_twitter> πŸ˜…
<FromGitter> <fusillicode_twitter> nested basically hashes
<FromGitter> <fusillicode_twitter> the problem is that I get the `can't cast Hash(Symbol, NoReturn) to Hash(Symbol, Hash(Symbol, String))` on this line ` rest_results.map { |rest_result| rest_result_to_h(rest_result).as(Hash(Symbol, Hash(Symbol, String))) }`
<FromGitter> <straight-shoota> You shouldn't use symbol hashes. In Ruby, they're used pretty extensively, but they're no good in Crystal. With dynamic data, you should use string keys instead.
<FromGitter> <fusillicode_twitter> ok no problem I can switch :)
<FromGitter> <straight-shoota> Your example looks very much like static data structures. Then you should really use `struct` instead of hashes.
<FromGitter> <fusillicode_twitter> mmm
<FromGitter> <straight-shoota> It's much simpler, easier to understand the purpose and way more efficient.
<FromGitter> <fusillicode_twitter> well the problem is that I need to `.to_json`
<FromGitter> <straight-shoota> And?
<FromGitter> <fusillicode_twitter> and `struct` doesn't have it
<FromGitter> <straight-shoota> it's as simple as `include JSON::Serializable`
<FromGitter> <fusillicode_twitter> mmm
<FromGitter> <fusillicode_twitter> sincerely I would like to keep the concern about the serialization separate πŸ€”
<FromGitter> <straight-shoota> It's nothing more separate with your current approach.
<FromGitter> <fusillicode_twitter> well in my approach I build a representation that should be serializable by default
<FromGitter> <fusillicode_twitter> an Hash :)
<FromGitter> <straight-shoota> But that's really not how it's supposed to be used πŸ˜†
<FromGitter> <fusillicode_twitter> :(
<FromGitter> <straight-shoota> If you only need these data structures to serialize to JSON, you should even consider to implement the serialization directly on `Rest::Result` etc.
<FromGitter> <straight-shoota> You can have full control over what gets serialized through implementing `#to_json(builder : JSON::Builder)` manually.
<FromGitter> <fusillicode_twitter> right now I can't really switch back
<FromGitter> <fusillicode_twitter> it would be awesome if I could get a clue about the reason behind the compiler error XD
<FromGitter> <fusillicode_twitter> anyway the `Rest::Result` is this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc7153f1e23486b93d2d798]
<FromGitter> <straight-shoota> I'm not sure how the `NoReturn` happens to appear
<FromGitter> <fusillicode_twitter> πŸ‘
<FromGitter> <straight-shoota> But looking at the code there are a few `.to_h` values when the return type should be `Hash(Symbol, String)`. You can't put that in there.
<FromGitter> <straight-shoota> You shouldn't need these `.as(Hash(Symbol, String))` anyway. They don't do anything.
<FromGitter> <straight-shoota> Try to remove them, maybe that influences the error.
<FromGitter> <fusillicode_twitter> I actually added `.as(Hash(Symbol, String))` trying to help the compiler
<FromGitter> <fusillicode_twitter> let me leave them and go back to my initial error XD
<FromGitter> <fusillicode_twitter> ok with this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc715ffef4afc4f2889a559]
<FromGitter> <fusillicode_twitter> I get : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc7160dc7bf7c366225e58e]
<FromGitter> <fusillicode_twitter> and this is where I began to add all the previous `.as` that you mentioned
<FromGitter> <fusillicode_twitter> πŸ˜…
<FromGitter> <straight-shoota> You would have to add the cast *in* the block body. That's the line 50
<FromGitter> <fusillicode_twitter> sure sure that was the first `.as` that I added ;)
<FromGitter> <fusillicode_twitter> but then
<FromGitter> <straight-shoota> But it would be a very complicated data type with many nested hashes and type unions
<FromGitter> <straight-shoota> That's why you shouldn't use `Hash` for this kind of thing.
<FromGitter> <fusillicode_twitter> ok this is clear
<FromGitter> <fusillicode_twitter> let me try one thing
<FromGitter> <straight-shoota> Your entire code could just be replaced by somthing like this in order to serialize do JSON: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc7170464cfc273f9de5149]
<FromGitter> <fusillicode_twitter> btw you've already been incredibly helpful so thanks really a lot πŸ™‡
<FromGitter> <fusillicode_twitter> wow
<FromGitter> <straight-shoota> Then you can just call `rest_results.to_json` and you're done. The same result with less hassle.
<FromGitter> <fusillicode_twitter> got it but unfortunately the `Crest::Response` comes from a shard πŸ€”
sagax has joined #crystal-lang
<FromGitter> <fusillicode_twitter> Question, could I use your approach but with a bare function?
<FromGitter> <fusillicode_twitter> I mean something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc718b6271506518d26f155]
<FromGitter> <fusillicode_twitter> In this way I would be able to keep the serialization concern separate
<FromGitter> <fusillicode_twitter> btw I'm trying it just now on play crystal ;)
DTZUZO_ has joined #crystal-lang
<FromGitter> <fusillicode_twitter> mmm
<FromGitter> <fusillicode_twitter> but what do I pass as a builder πŸ€”
<FromGitter> <straight-shoota> I wouldn't do it like that. You can either reopen the class (just put the code I posted somewhere in your codebase).
<FromGitter> <straight-shoota> That could lead to problems when the crest classes should get their own json serialization at some point.
<FromGitter> <fusillicode_twitter> with *That* you mean what I propose?
<FromGitter> <straight-shoota> No, what I proposed.
<FromGitter> <fusillicode_twitter> indeed, then I smelled the problem right
<FromGitter> <straight-shoota> πŸ‘
<FromGitter> <straight-shoota> I'd use a JSON converter for this.
<FromGitter> <fusillicode_twitter> a converter?
<FromGitter> <fusillicode_twitter> mmm
<FromGitter> <straight-shoota> Well that's essentially what you posted
<FromGitter> <straight-shoota> I misread the code initially πŸ™ˆ
<FromGitter> <fusillicode_twitter> the dummy function right?
<FromGitter> <fusillicode_twitter> wait
<FromGitter> <fusillicode_twitter> the intial hash thingy?
<FromGitter> <fusillicode_twitter> lol I'm getting confused XD
<FromGitter> <straight-shoota> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc71b946e5a401c2d8675d5]
<FromGitter> <fusillicode_twitter> okok then I only miss how to create an JSON::Builder XD
<FromGitter> <straight-shoota> Instead of ⏎ ⏎ ```builder.field "response" { self.class.to_json(response, builder) }``` [https://gitter.im/crystal-lang/crystal?at=5bc71bd2c7bf7c366226113b]
<FromGitter> <fusillicode_twitter> mmm
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <j8r> @straight-shoota the only way will be to have a mode to forbid class reopening of `MyClass` in specs outside the `myclass_spec.cr`, to do incremental compilation :/
<FromGitter> <straight-shoota> Nah, that's not the only issue
<FromGitter> <straight-shoota> Method argument and return types also depend on the types available in the entire program, which can obviously change between compilations.
<FromGitter> <j8r> the main blocking points are type inference and class reopening?
rohitpaulk has joined #crystal-lang
<FromGitter> <fusillicode_twitter> well I think that I'm totally stuck...
<FromGitter> <straight-shoota> @j8r Class reopening probably isn't much of a problem for incremental compilation because it doesn't change frequently and is easy to detect. I just mentioned it in response to your file == module statement.
<FromGitter> <straight-shoota> @fusillicode_twitter how?
<FromGitter> <fusillicode_twitter> well in general at the point to have a separate serialization logic :(
<FromGitter> <fusillicode_twitter> I mean not having to include json logic inside the class that I want to serialize
<FromGitter> <fusillicode_twitter> That's why I was trying with a total external function like : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc71fb1f659e67772cd9c2f]
<FromGitter> <fusillicode_twitter> but it seems that it is not possible to have it outside the class that I want to serialize, or at least it seems to me from your last suggestion :(
marmotini_ has joined #crystal-lang
marmotini has joined #crystal-lang
<FromGitter> <fusillicode_twitter> I think that the only option that remains is to use `JSON.build`
<FromGitter> <fusillicode_twitter> i.e. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc7253bef4afc4f288a0ef8]
<FromGitter> <fusillicode_twitter> :'(
marmotini_ has quit [Ping timeout: 250 seconds]
<helaan> Anyone who has tips on crosscompiling the Crystal compiler?
<helaan> When I try running it, it throws "Error parsing inline asm"
<FromGitter> <straight-shoota> @fusillicode_twitter No, you should really be able to define that function anywhere. As long as it can access the properties of the type it needs to serialize.
<FromGitter> <fusillicode_twitter> ok but I still need to pass a JSON::Buidlder instance and sincerely I don't know how to instantiate it
<FromGitter> <fusillicode_twitter> in particular I don't know what `IO` to pass it :(
<FromGitter> <straight-shoota> helaan what target are you trying to cross compile to?
<FromGitter> <straight-shoota> @fusillicode_twitter It takes any IO. Depends on what you want to do. Do you want to write to a file? A socket? Just pass it in. ⏎ If you need the JSON as String, use a String::Builder.
<FromGitter> <fusillicode_twitter> exactly this String::Builder!!!
<FromGitter> <fusillicode_twitter> let me try :D
<helaan> straight-shoota: either armv7a or aarch64, either would make me happy
rohitpaulk has quit [Ping timeout: 250 seconds]
<FromGitter> <fusillicode_twitter> @straight-shoota mmm...ok now...a String::Builder is instantiated with?
<helaan> Currently mostly trying to compile for the armv7a-unknown-linux-gnueabihf triple though
<FromGitter> <fusillicode_twitter> btw I have the doc at eye
<FromGitter> <straight-shoota> helaan, hm the docs list only `armv7-linux-gnueabihf`... Is there a compatibilty difference between armv7 and armv7a?
<FromGitter> <straight-shoota> I'm not very familiar with this subject...
<helaan> straight-shoota: Not as far as I'm aware, it is just that this is the normal gcc triple for the target system
<FromGitter> <straight-shoota> @fusillicode_twitter `string = String.build do |io| do_somthing_with(io) end`
<helaan> Running it with armv7-linux-gnueabihf also crashes, same message
<FromGitter> <straight-shoota> okay
<helaan> I checked out the crystal repo and ran `make FLAGS="--cross-compile --target armv7-linux-gnueabihf" progress=1`
<FromGitter> <fusillicode_twitter> ok then I think that even that will not work
<FromGitter> <straight-shoota> yeah that should work... you might try something smaller than the compiler
<FromGitter> <straight-shoota> like cross compile a hello world
<FromGitter> <straight-shoota> So "Error parsing inline asm" is an LLVM error, so either the compiler is passing it the wrong target ASM or the ASM is buggy.
<FromGitter> <straight-shoota> @fusillicode_twitter why not?
<FromGitter> <fusillicode_twitter> because `String.build do |io| do_somthing_with(io) end` returns a `String`
<FromGitter> <fusillicode_twitter> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc72abe82893a2f3bf67bc8]
<FromGitter> <straight-shoota> yeah? What do you want it to return?
<helaan> I tried my own app, that almost works, but it crashes when I try an HTTP post, so I hoped running the compiler natively would solve that
<FromGitter> <fusillicode_twitter> I would like to `JSON::Builder.new(<here>)`
<FromGitter> <fusillicode_twitter> and <here> should be a `StringBuilder` instance
<FromGitter> <straight-shoota> just put JSON::Builder.new(io) in the block
<FromGitter> <fusillicode_twitter> https://play.crystal-lang.org/#/r/598e
<FromGitter> <straight-shoota> helaan, it shouldn't make a difference if you compile for the same target or a different one.
<FromGitter> <straight-shoota> It's probably best if you open an issue (or actually, probably two)
<FromGitter> <straight-shoota> please include full error messages, llvm and crystal versions
<FromGitter> <straight-shoota> @fusillicode_twitter https://play.crystal-lang.org/#/r/598j
<helaan> Ok, will do. With respect to my post issue, it crashes only if it is contained in a Kemal block, should that make it a Kemal issue or a compiler issue?
<FromGitter> <fusillicode_twitter> thanks @straight-shoota :(
<FromGitter> <straight-shoota> depends... can you show me the code?
<helaan> That code works fine on amd64, but on arm it crashes
<FromGitter> <vladfaust> Sorry for the delay, rethinking stuff :) https://snag.gy/ZgOw2I.jpg
<helaan> Invalid memory access (signal 7) at address 0x749a23e4
<helaan> [0x12d124] ???
<helaan> [0x6b0e4] __crystal_sigfault_handler +72
<FromGitter> <straight-shoota> okay, that should be a crystal issue
<FromGitter> <straight-shoota> kemal shouldn't care about which arch it's compiled to
<helaan> I thought it was something to do with threads/fibers, but it is 100% reproducible
<FromGitter> <straight-shoota> unfortunately we have no CI infrastructure for arm so it's easy that there might be some undiscovered issues
<helaan> Yeah, arm hardware just isn't as popular as x86 and the embedded crystal isn't a thing either
<jokke> hey there fellow webdevs o/ Check out https://github.com/jreinert/guardian It can monitor your files, build your target when they change, and restart the running target. It also starts a webserver at a user definable port (using the `-w` cli flag) which allows connecting via websocket and sends a message to the websocket when the target has restarted. You can also configure a string to watch for from
<jokke> the program stdout to know when it's up and running.
<jokke> in a nutshell: shotgun for crystal with live reload support
<helaan> Also, I noticed that if you rebuild LLVM with extra targets support, you need to rebuild crystal afterwards to make Crystal pick up these targets
<helaan> But I think that is a Gentoo bug
<FromGitter> <jgaskins> hey everyone, I'm having some trouble with `reuse_port` on `HTTP::Server`. I've got `reuse_port` enabled on my `HTTP::Server` instances so I could split the workload across multiple processes (as discussed here (https://github.com/spider-gazelle/action-controller/blob/master/clustering.md)), but every request is being handled by the first process to bind to the port.
<FromGitter> <jgaskins> I'm on macOS Mojave if that helps. Latest Crystal version.
<FromGitter> <proyb6> @jgaskins what is the error you were facing?
<FromGitter> <jgaskins> There's no error, the other processes just aren't getting the request.
<FromGitter> <proyb6> How about let us seeing your code?
<FromGitter> <straight-shoota> have you tried reuse_port with any other software on your system?
<FromGitter> <jgaskins> The `PrintPid` handler was just to see if the app was distributing the requests *at all*, because only one process was getting lit up when I ran `wrk` against it.
<FromGitter> <straight-shoota> could you run this without fork? Just execute the same binary multiple times?
<FromGitter> <jgaskins> @straight-shoota No, I haven't used `reuse_port` before. Last time I built anything that worked this closely with sockets, `SO_REUSEPORT` didn't exist yet. :-)
<FromGitter> <jgaskins> @straight-shoota I did try removing forking and just run it in multiple terminal windows. Same exact thing happened.
<FromGitter> <aboeglin> @jokke is it still running ?
<FromGitter> <bararchy> Didn't even noticed that it shows this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Really helpful to newcomers [https://gitter.im/crystal-lang/crystal?at=5bc738fe3a42fa76532ebe11]
<jokke> aboeglin: it is!
<jokke> amazing! so: the fix for me was just to prepend the service names with "tasks."
<FromGitter> <aboeglin> @jokke what service names ? The postgres services ?
<jokke> yeah
<jokke> so in my docker-compose file there's postgres under services.db
<jokke> so before i set my db hostname for the app to be just "db"
<jokke> now i set it to "tasks.db"
<FromGitter> <aboeglin> so you have services.tasks.db ?
<FromGitter> <aboeglin> like ⏎ ⏎ ```tasks.db: ⏎ image: 'bitnami/postgresql:latest' ⏎ ...``` ⏎ ⏎ ? [https://gitter.im/crystal-lang/crystal?at=5bc73fc5ae7be94016709165]
marmotini has quit [Ping timeout: 250 seconds]
<FromGitter> <fridgerator> @proyb6 I think `reuse_port` only works on linux
<FromGitter> <proyb6> @fridgerator I agree, macOS seems to have a different implement than Linux that is better on load balancer
<FromGitter> <j8r> @bew thanks, indeed very interesting!
marmotini_ has joined #crystal-lang
baweaver has quit [*.net *.split]
bmcginty has quit [*.net *.split]
<helaan> I managed to get a crosscompiler built for arm, turned out the tuple was arm-unknown-linux-gnueabihf, but am unable to link it, as it can't find AArch64 and X86 support in the LLVM compiler on the target (which is correct)
marmotini_ has quit [Ping timeout: 252 seconds]
marmotini_ has joined #crystal-lang
sagax has quit [Quit: Konversation terminated!]
<helaan> Would it be useful to specify the targets Crystal will build itself for? Currently it looks at llvm-config to see what LLVM has been built with and enables everything it can. This causes issues when crosscompiling because the target may have LLVM built with a subset of targets
<jokke> aboeglin
<jokke> no
<jokke> i didn't change anything about the structure of the docker-compose.yml
<jokke> i'll just paste it to you. easier
<f1refly> I'm trying to make a package for the arch linux aur for a crystal program
<jokke> f1refly: cool :)
<f1refly> Makepkg complains that the crystal program binary contains a referece to the build dir
<f1refly> It is compiled with the --release option
<f1refly> Is there some way to stop the compiler from including this reference?
<jokke> hm
<jokke> can't remember if i had that problem
<jokke> but that's also just shards build --release
<f1refly> Hm
<f1refly> This is my first time making an aur package, maybe i did something wrong
<jokke> can i have a look?
<jokke> also jhass might be able to help. he's also an arch-linux user and has built some packages iirc
<f1refly> Its as basic as it gets
<jokke> f1refly: duuuude! :D
<jokke> :D
<jokke> one of us should rename :P
<jokke> when's your initial commit? :P
<f1refly> The other one is not mine, i just use it :)
<jokke> yeah i know, i'm jreinert
<f1refly> its 01.01.16
<jokke> oh god damn
<jokke> :D
<f1refly> :D
<jokke> i should research names
<f1refly> It's really hard nowadays
<f1refly> When i made my bugtracker all the good ones where allready gone ^^
<jokke> ^^
<f1refly> So, any idea why this gives me a warning?
<FromGitter> <j8r> you'll rename the project jokke?
<jokke> have you tried using shards build --release instead? (i doubt it changes anything but worth a try)
<jokke> j8r: yeah i'll have to
<helaan> Noticed the same, it looks like it is including the source file name in the binary.
<jokke> hm paladin sounds nice
<jokke> \o/
<FromGitter> <straight-shoota> helaan have you seen #6903 ?
<f1refly> jokke: I tried, put apart from nicer output it doesn't change a thing
<helaan> straight-shoota: Now I have. Wasn't aware of the Github wiki existing.
<f1refly> I don't think anybody was bothered by this in the first place tbh :)
<jokke> but it's confusing
<jokke> f1refly: what do you use guardian for?
<f1refly> Pretty much everything that needs build on changes
<jokke> mhm
<f1refly> Currently im trying to transpose "still alive" by lisa miskovsky with abc notation and use guardian to auto-compile it to pdf
<jokke> hah cool
<f1refly> One of the reasons i submitted my makefile patch to it today
<jokke> yeah guardian is more universal. paladin is exclusively for crystal projects.
<f1refly> yeah
<f1refly> the crystal project integration of guardian works pretty good tho
<jokke> does it kill running processes?
<f1refly> So
<f1refly> No
<jokke> yeah. that's a must for webdevelopment imho
<f1refly> Theres an issue for that, but nobody bothered
<jokke> which is why i wrote my shard
<jokke> it even has autoreload
<f1refly> I get that, but it's hard to tell what to kill when all you have is a target and a line to execute
<f1refly> That's pretty cool
<jokke> exactly
<jokke> well
<jokke> you can just kill whatever you started
<f1refly> The guardian.yml would need to have an extra option to tell it what to kill i reckon
<jokke> probably
<f1refly> But i'm not into webdevelopment so i don't really care ;)
<jokke> you would have to watch the binary or something
<f1refly> Yeah
<jokke> i noticed a funny coincidence: everyone who's on arch-linux is connected via irc ;)
<jokke> maybe it's not coincidence but preference
<f1refly> I guess so, yeah
<jokke> i hate that there's no tab completion for gitter users tho
<f1refly> I see arch linux more as a hobby that i got so proficient with that it's fine for daily use
<f1refly> I don't really mind
<jokke> :)
<f1refly> What do you think, should i submit the package despite the warning?
<jokke> asterite: so is there any way to suppress adding the source file name to the compiled binary?
<jokke> f1refly: yeah
helaan has quit [Ping timeout: 272 seconds]
<f1refly> Are aur and archlinux bbs accounts seperate?
<FromGitter> <aboeglin> @jokke oh, so it's actually for the host you connect to
<f1refly> It's on the aur :D
<FromGitter> <aboeglin> @jokke I just tried it, it's live right now, we'll see !
Jenz has joined #crystal-lang
<jokke> aboeglin: πŸ‘
<jokke> f1refly: πŸ‘
<jokke> aboeglin: mine still works
<jokke> i really hope this was it
bmcginty has joined #crystal-lang
Jenz has quit [Ping timeout: 252 seconds]
robacarp has joined #crystal-lang
wontruefree has joined #crystal-lang
Jenz has joined #crystal-lang
<FromGitter> <aboeglin> Still up :o
<FromGitter> <j8r> I'm on Lubuntu, Manjaro and has been on Debian and openSUSE - everything that has LXQt :) At the end, there isn't much differences. I would like to go to Alpine but for now packages are missing
rohitpaulk has joined #crystal-lang
non-aristotelian has joined #crystal-lang
<Jenz> Why alpine at all?
Jenz has quit [Ping timeout: 252 seconds]
baweaver has joined #crystal-lang
Jenz has joined #crystal-lang
wontruef_ has joined #crystal-lang
wontruefree has quit [Ping timeout: 245 seconds]
helaan has joined #crystal-lang
<helaan> Hmm, not sure exactly what the crash it, but my crosscompiler exhibits it as well
return0xe has joined #crystal-lang
return0e has quit [Ping timeout: 245 seconds]
<FromGitter> <j8r> Alpine because light – busybox, openrc, simple packaging
<Jenz> Huh, ok sounds like it's worth looking into, thanks @j8r!
<helaan> Ooh, I got the amd64 version of the compiler to crash, segfault
<Jenz> I've done that a couple of times of x86_64 as well :D
<Jenz> Why am I so happy about that
<helaan> Let it crash, let it burn, can't hold it back anymore
<helaan> Probably not that bad of a crash, compiled crystal with both --release and --debug for arm
Heaven31415 has joined #crystal-lang
<Heaven31415> Hi
rohitpaulk has quit [Ping timeout: 252 seconds]
<Jenz> Hello Heaven31415
marmotini_ has quit [Ping timeout: 245 seconds]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Ping timeout: 252 seconds]
<FromGitter> <valamorgon> how can I pop last char from IO
<FromGitter> <valamorgon> I need the last char to be removed from my IO
<FromGitter> <valamorgon> but not after to_s
marmotini_ has joined #crystal-lang
<jhass> do you know how much data comes before/the total length?
<FromGitter> <valamorgon> unfortunately no
<FromGitter> <valamorgon> maybe my logic is wrong I am using something like this
<FromGitter> <valamorgon> children.each do |child| ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bc7911df659e67772d0c880]
<FromGitter> <valamorgon> to put comma between each value
<jhass> oh you mean when writing
<jhass> google "post fence problem"
marmotini_ has quit [Ping timeout: 246 seconds]
<jhass> you either have to do the first or the last item outside the loop and start the loop with either the second item or stop it before the last
<FromGitter> <valamorgon> thanks man, I simply checked if first or not now, but I normally remove last char after loop in other languages, don't know if it is considered bad habit though
<jhass> well why do work and then undo it if you can just not do it ;)
<FromGitter> <valamorgon> well it doesnt force me to use extra if statement but messy anyway :)
<FromGitter> <straight-shoota> If it wasn't for the condition in the loop, you could just use `#join`
return0xe has quit [Quit: Leaving]
<FromGitter> <valamorgon> if it was javascript I would .filter().join() because hail satan
Jenz has quit [Quit: leaving]
<jhass> well, actually what's children? maybe you can just get an iterator from it and do exactly that
<FromGitter> <valamorgon> it is xml nodeset
return0xe has joined #crystal-lang
<jhass> yeah nvm, join doesn't give access to the io anyway
<helaan> Not that much of a Crystal expert, didn't test it, but maybe something like this: `children.select{ |child| child.name == "value" }.join(",", io)` ?
<jhass> misses the parse(...) call
<helaan> You could throw a map in the middle of it, but then you need to alloc nodes
<jhass> the select most likely already allocs another array
<helaan> My suggestion then would to use the original code and output a comma before outputting every item after the first
<jhass> but yeah the map would add another one + child results
wontruef_ has quit [Quit: bye]
<FromGitter> <fridgerator> Does crystal have issues resolving an address through a docker container link?
<jokke> aboeglin: good to hear. Hope it's fixed for you too :)
<FromGitter> <jwoertink> Anyone else run in to closed stream errors using postgres?
<FromGitter> <michelson> Hi!!
<FromGitter> <michelson> i'm receiving an object with this type: `(Hash(String, String) | Int32)`
<FromGitter> <michelson> what that means ?
<FromGitter> <michelson> I'm trying to parse the hash, but it throw errors telling that [] is undefined method for Int32
<FromGitter> <michelson> surprise! :(
<helaan> @michelson: You have an union type: either it is a hash with Strings as keys and values OR it is an integer.
<helaan> If you want to do something, you need to have an operation that is valid on both types or make sure that your object is either an integer or an hash
helaan has quit [Quit: WeeChat 2.2]
marmotini_ has joined #crystal-lang
Raimondii has joined #crystal-lang
marmotini_ has quit [Ping timeout: 246 seconds]
marmotini_ has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
marmotini has joined #crystal-lang
marmotini_ has quit [Ping timeout: 246 seconds]
<FromGitter> <michelson> thanks
<Heaven31415> Is there a way to pass arguments to a program when I'm running it using `crystal run foo.cr`?
<FromGitter> <bararchy> So... any one made a cli to crawl a website from url and export all data to `HAR` file?
<FromGitter> <bararchy> :)
<FromGitter> <straight-shoota> Heaven31415 `crystal run foo.cr -- args`
<Heaven31415> thanks dude
<FromGitter> <michelson> `list = [] of String => String` is this invalid code ?
<FromGitter> <bajro17> you probably need do list = {} of String => String
<FromGitter> <bajro17> if you want to make hash
<FromGitter> <bajro17> @michelson
<FromGitter> <michelson> I want an array of hashes
<FromGitter> <michelson> how can I do that ?
<FromGitter> <michelson> ha `processes = [] of Hash(String, String)`
<FromGitter> <bajro17> I dont know is it possible like [] of {} of String => String
<FromGitter> <bajro17> maybe you can try
<FromGitter> <straight-shoota> @bajro17 no
<FromGitter> <straight-shoota> `{} of String = > String` initializes an instance, it can't be used in the type grammar
marmotini has quit [Read error: Connection reset by peer]
marmotini_ has joined #crystal-lang
marmotini has joined #crystal-lang
marmotini_ has quit [Ping timeout: 245 seconds]
marmotini has quit [Read error: Connection reset by peer]
marmotini has joined #crystal-lang
marmotini has quit [Remote host closed the connection]
marmotini has joined #crystal-lang
marmotini_ has joined #crystal-lang
marmotini has quit [Ping timeout: 246 seconds]