ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
<faustinoaq> > Oh, maybe we are being a bit harsh on you. You know what? Don’t go away. Come back.
<faustinoaq> :)
sz0 has joined #crystal-lang
illyohs has quit [Quit: Leaving]
illyohs has joined #crystal-lang
illyohs has quit [Client Quit]
illyohs has joined #crystal-lang
notdaniel has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
p0p0pr37_ has joined #crystal-lang
vegai has quit [Ping timeout: 248 seconds]
faustinoaq has quit [Ping timeout: 248 seconds]
Cyrus has quit [Ping timeout: 248 seconds]
faustinoaq has joined #crystal-lang
p0p0pr37 has quit [Ping timeout: 248 seconds]
badeball has quit [Ping timeout: 248 seconds]
p0p0pr37_ is now known as p0p0pr37
vegai has joined #crystal-lang
badeball has joined #crystal-lang
<faustinoaq> Wow ...Julia has run at petascale on 650,000 cores with 1.3 million threads to analyze over 56 terabytes of data using Cori, the world’s sixth-largest supercomputer...
Cyrus has joined #crystal-lang
Cyrus is now known as Guest77633
<FromGitter> <zyriuse75> i 've a stupid issue
<FromGitter> <zyriuse75> i read file where i wrote something inside but he doesn't display anything ?
<FromGitter> <zyriuse75> File.open("webSite.txt", "r") do |line| ⏎ puts #{line} ⏎ end
<FromGitter> <zyriuse75> i dont understand why
<faustinoaq> @zyriuse75, try `File.read("webSite.txt")`
FromGitter has quit [Ping timeout: 250 seconds]
FromGitter has joined #crystal-lang
<FromGitter> <zyriuse75> ok but i wrote File.open("...", "r") so normally it have to read it right ?
cptaffe has quit [Ping timeout: 240 seconds]
braidn[m] has quit [Ping timeout: 252 seconds]
kp666[m] has quit [Ping timeout: 255 seconds]
sija[m] has quit [Ping timeout: 246 seconds]
olbat[m] has quit [Ping timeout: 246 seconds]
thelonelyghost has quit [Ping timeout: 264 seconds]
tybee[m] has quit [Ping timeout: 255 seconds]
byteflame has quit [Ping timeout: 252 seconds]
TheGillies has quit [Ping timeout: 255 seconds]
weston_[m] has quit [Ping timeout: 264 seconds]
dtcristo has quit [Ping timeout: 276 seconds]
Renich has quit [Ping timeout: 276 seconds]
watzon has quit [Ping timeout: 248 seconds]
<faustinoaq> If you want read line by line you can use [#each_line](https://crystal-lang.org/api/0.23.1/File.html#each_line%28filename%2Cencoding%3Dnil%2Cinvalid%3Dnil%2Cchomp%3Dtrue%2C%26block%29-class-method) method
<FromGitter> <vonKingsley> @zyriuse75 File.open passes the file to the block not each line
sam0x17 has joined #crystal-lang
<sam0x17> is the easiest way to shell out still using the Process class? there's no support for backtick shell execution like in Ruby right?
[spoiler] has quit [Ping timeout: 240 seconds]
[spoiler] has joined #crystal-lang
<FromGitter> <vonKingsley> sam0x17 you can use backticks https://crystal-lang.org/api/0.23.1/toplevel.html#%60%28command%29%3AString-class-method
lemur has joined #crystal-lang
lemur has quit [Changing host]
lemur has joined #crystal-lang
[spoiler] has quit [Ping timeout: 276 seconds]
baweaver has quit [Max SendQ exceeded]
[spoiler] has joined #crystal-lang
lemur is now known as baweaver
greengriminal has joined #crystal-lang
<sam0x17> @vonKingsley thanks!
sam0x17 has quit [Quit: leaving]
sam0x17 has joined #crystal-lang
sam0x17 has quit [Quit: leaving]
sam0x17 has joined #crystal-lang
sam0x17 has left #crystal-lang [#crystal-lang]
sam0x17 has joined #crystal-lang
<FromGitter> <marksiemers> There is a chance that crystal-raw can get a 25-60% performance increase on the TechEmpower benchmarks for database actions by tweaking the connection pool settings. ⏎ I've seen this while running the benchmarks on a virtualbox on my laptop with these changes: https://github.com/marksiemers/FrameworkBenchmarks/commit/50811f9f8712b2015ef96c073fbdde8f3125a82a ⏎ ⏎ I think is worth trying it in an
<FromGitter> ... isolated environment - has anyone been able to run the benchmarks on 3 different machines (AWS instances) to more closely mimic what TechEmpower does? ⏎ They have one for the client (running wrk), one for the app server, and one for the db server. [https://gitter.im/crystal-lang/crystal?at=5a03dc13f7299e8f538d6799]
notdaniel has quit [Quit: Leaving]
illyohs has quit [Ping timeout: 268 seconds]
greengriminal has quit [Quit: Leaving]
sz0 has quit [Quit: Connection closed for inactivity]
wontruefree has joined #crystal-lang
<FromGitter> <bararchy> @serdardogruyol is working with Kemal on those benchmarks , he might be interested in this ^
<FromGitter> <marksiemers> yeah, I applied the connection pool changes to all 3 (crystal-raw, kemal, and amber)
<FromGitter> <marksiemers> It is possible that further tweaks can be made, both to those settings, and potentially the GC_MARKER number, relative to the logical CPUs available
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
<FromGitter> <marksiemers> If @sdogruyol has gone through the steps of figuring out the 3 server setup to test - that would be great! ⏎ Somehow, benchmarking plaintext on my 2 core laptop, I'm getting 4x (for amber) the performance of TechEmpower's 80 core machine!
olbat[m] has joined #crystal-lang
<crystal-gh> [crystal] wontruefree opened pull request #5263: updating the example comments to be usable by curl (master...patch-1) https://git.io/vFuil
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
wontruef_ has joined #crystal-lang
c-c_ has joined #crystal-lang
saadq has quit [Ping timeout: 248 seconds]
minus has quit [Ping timeout: 248 seconds]
c-c has quit [Ping timeout: 248 seconds]
shelvacu has quit [Ping timeout: 248 seconds]
hallomann has quit [Ping timeout: 248 seconds]
dom96 has quit [Ping timeout: 248 seconds]
hallomann has joined #crystal-lang
dom96 has joined #crystal-lang
dom96 has joined #crystal-lang
dom96 has quit [Changing host]
shelvacu has joined #crystal-lang
sam0x17_ has joined #crystal-lang
braidn[m] has joined #crystal-lang
byteflame has joined #crystal-lang
kp666[m] has joined #crystal-lang
Renich has joined #crystal-lang
tybee[m] has joined #crystal-lang
TheGillies has joined #crystal-lang
cptaffe has joined #crystal-lang
thelonelyghost has joined #crystal-lang
watzon has joined #crystal-lang
sija[m] has joined #crystal-lang
weston_[m] has joined #crystal-lang
vifino has quit [Ping timeout: 240 seconds]
wontruefree has quit [*.net *.split]
olbat[m] has quit [*.net *.split]
sam0x17 has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
binBASH has quit [*.net *.split]
[spoiler] has joined #crystal-lang
olbat[m] has joined #crystal-lang
dtcristo has joined #crystal-lang
wontruef_ has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
minus has joined #crystal-lang
mjblack has quit [Ping timeout: 264 seconds]
oz has quit [Ping timeout: 255 seconds]
saadq has joined #crystal-lang
alex`` has joined #crystal-lang
mjblack has joined #crystal-lang
Yxhvd has quit [Ping timeout: 240 seconds]
flaviodesousa has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
mark_66 has joined #crystal-lang
Yxhuvud has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
sam0x17_ has quit [Ping timeout: 268 seconds]
handicraftsman has quit [Ping timeout: 268 seconds]
foxbot has quit [Ping timeout: 258 seconds]
foxbot has joined #crystal-lang
early has quit [Ping timeout: 258 seconds]
early has joined #crystal-lang
handicraftsman has joined #crystal-lang
oz has joined #crystal-lang
<crystal-gh> [crystal] jreinert opened pull request #5264: add custom extension support for Tempfile (master...tempfile-extension) https://git.io/vFudn
vifino has joined #crystal-lang
<FromGitter> <Qwerp-Derp> How do I link my program to existing dylibs?
claudiuinberlin has quit [Read error: Connection reset by peer]
<oprypin> Qwerp-Derp‎, you add a @[Link] annotation to your `lib`, make sure the full path to their directory is in `LIBRARY_PATH` during compilation, makesure the full path to their directory is in `LD_LIBRARY_PATH` during runtime
<FromGitter> <Qwerp-Derp> I actually want to link my compiled CrSFML program to the CrSFML dylibs so I can run the binary independently, sorry if I didn't clarify
<oprypin> it is very difficult and I don't know how to do that
<oprypin> your binary will not be independent anyway, it has dependencies on other system libraries
<FromGitter> <Qwerp-Derp> ???
<oprypin> libgc, for one
<oprypin> you can ship the dylibs alongside your binary, then see the 2nd half of my first message
<FromGitter> <Qwerp-Derp> So I need all of these dylibs in order to get the Crystal program to work on devices which don't have Crystal?
<FromGitter> <Qwerp-Derp> That seems super cumbersome
<oprypin> not all of them but yes
<oprypin> libgc, libevent-core are 100% needed, others may be situational, like gmp for `big`, xml, yaml, etc
<oprypin> and `git` `llvm` are needed to compile crystal but not in general
<oprypin> meh why am i even saying this. you can just check which libraries your binary depends on
<oprypin> Qwerp-Derp‎, on linux that's `ldd binary_name`. on mac that might be `otool` or something, i have no idea
<Papierkorb_> Qwerp-Derp, cumbersome at first, but great apart from that: 1) Sharing libs between programs saves a *ton* of disk space, even by todays standards 2) Libraries can be independently updated, long after you stopped maintaining the program 3) Depending on the lib, legal reasons
<FromGitter> <Qwerp-Derp> Argh Crystal to binary is hard :(
<FromGitter> <r3bo0t> > **<Papierkorb_>** @Qwerp-Derp, cumbersome at first, but great apart from that: 1) Sharing libs between programs saves a *ton* of disk space, even by todays standards 2) Libraries can be independently updated, long after you stopped maintaining the program 3) Depending on the lib, legal reasons ⏎ Yes, sharing libraries b/w projects/programs makes sense, but if we have shared libraries…updating a library for
<FromGitter> ... one program might break others from working(possible)
<FromGitter> <r3bo0t> Unless we can have multiples versions of same libraries maintained and shards manage the program level dependency for a particular library
<FromGitter> <r3bo0t> something that ruby does with rubygems and rom/rbenv
<Papierkorb_> Please don't copy/paste long messages. It's really hard to see if you even added upon that.
<Papierkorb_> Simply @ The person, the context will be clear anyhow
<Papierkorb_> And that is basically an solved issue
<FromGitter> <r3bo0t> @ Papierkorb_ noted
<Papierkorb_> "Solved issue" regarding sharing different versions
<Papierkorb_> At least for linux we have `libfoo.so.X.Y.Z`
<oprypin> benefits of dynamic linking diminish over time. sharing different versions is not possible to ever solve.
<Papierkorb_> Security benefits don't diminish over time, the opposite
<oprypin> true
<Papierkorb_> how many programs are still out there that are now security disasters because they linked statically to openssl?
<Papierkorb_> I mean sure, for many non-security related things (Though everything that does networking, file parsing, etc. *is* security related) static linking is no issue. I guess statically linking to `fancyline` will never be an issue (.. I hope)
<Papierkorb_> Though dynamic linking has one other benefit depending on the platform. At least windows doesn't allow you to export symbols from the application binary. If you link statically to a lib that can load plugin libraries, these plugins won't be able to link to the (statically linked) library - Hence, won't work anymore.
<Papierkorb_> Linux doesn't have that issue, no idea about mac
<FromGitter> <Qwerp-Derp> I moved all the relevant files to a `dylib` folder, and I want to compile a file called `src/mirrors.cr` into `bin/mirrors`, how would I do that?
<oprypin> as I mentioned before, `export LIBRARY_PATH=/full/path/to/that/dylib; export LD_LIBRARY_PATH=/full/path/to/that/dylib`
<FromGitter> <Qwerp-Derp> How do I link to a local folder in `gcc` using `export`?
<jokke> hey
<jokke> i want to add O_EXCL to the libc bindings
<jokke> how can i find the values for the different architectures?
<FromGitter> <petoem> https://github.com/rust-lang/libc/search?utf8=%E2%9C%93&q=O_EXCL&type= ⏎ @jokke maybe this helps ⏎ i don't know if the values are right, but they are from rust-lang/libc 😄
<jokke> cool thanks
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
Bish has joined #crystal-lang
<Bish> Howdy, do you have cool threads yet?
alex`` has quit [Quit: WeeChat 1.9.1]
<oprypin> no, just broken ones
alex`` has joined #crystal-lang
sam0x17 has joined #crystal-lang
<Bish> oprypin: eh?
hightower2 has joined #crystal-lang
<Bish> well, what does that mean?
<Bish> last time i checked, crystal wasn't able to spread over multiple cores, i won't be able to read that in there as quick as asking here
<Bish> oh, there hasn't been done much since 2014.. i get it.
<Bish> too bad, crystal looks awesome
<Bish> faustinoaq: thanks alot
<FromGitter> <Rinkana> I'm mapping some C lib things to Crystal. However I'm having issues with the following: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ The sequence of items seems wrong aswell as the data that's in it. [https://gitter.im/crystal-lang/crystal?at=5a045687f7299e8f538fefcb]
<FromGitter> <bew> What do you mean "when I request the object"? How are you requesting it ?
<FromGitter> <Rinkana> It's another function within the C lib
<FromGitter> <Rinkana> But i've found the issue
<FromGitter> <Rinkana> I get a pointer back to that object
<FromGitter> <Rinkana> And not the value itself
<crystal-gh> [crystal] Sija opened pull request #5265: Add #clear method to ArrayLiteral/HashLiteral (master...arrayliteral-clear) https://git.io/vFzWh
<FromGitter> <Sevensidedmarble> can anyone tell me why I get this error?
<FromGitter> <Sevensidedmarble> https://pastebin.com/dbqvXuNY
<FromGitter> <Sevensidedmarble> I have a variable that holds either a Process or nil, and I check to make sure it's not nil before calling a method on it but I still get an error as if I didnt
<faustinoaq> @Sevensidedmarble, try https://pastebin.com/Q5UhSdgT
vifino has quit [Quit: Who turned this off?! D:<]
<faustinoaq> Sometimes the compiler isn't smart enough, so you need to help him :)
<FromGitter> <Sevensidedmarble> thanks @faustinoaq that worked the way I was looking for
<FromGitter> <Sevensidedmarble> and I didn't know about that not_nil! method, thats really interesting
<FromGitter> <bew> @Sevensidedmarble the first example is better IMO ;)
<FromGitter> <Sevensidedmarble> yes that is what I opted for as well
<FromGitter> <petoem> @Sevensidedmarble be aware that, not_nil! will raise when self is nil
<FromGitter> <Sevensidedmarble> ah, thats good to know thank you
<FromGitter> <petoem> https://crystal-lang.org/api/0.23.1/Object.html#try%28%26block%29-instance-method ⏎ you can use "try" instead, if you don't want it to raise
<Papierkorb_> Sevensidedmarble, updated fancyline yesterday, among it RPROMPT support
<FromGitter> <Sevensidedmarble> thats awesome
<FromGitter> <Sevensidedmarble> I'm having some issues wrapping my head around what I'm doing wrong when it comes to ending processes though, this line: https://github.com/Sevensidedmarble/crysh/blob/67fb272d964e7867b33867c4b98435ad9db10d98/src/crysh.cr#L33 I thought would work since fg there refers to the right process, but when I run it It seems like the control sort of returns to the main process but something's not quite right
<FromGitter> <Sevensidedmarble> if anyone has any thoughts I'd greatly appreciate it. I'm not seeing what I'm doing wrong here.
<FromGitter> <Sevensidedmarble> maybe I'm thinking about this wrong. will calls to Process.fork pass that handler I've defined in the main program to the new process?
<FromGitter> <Sevensidedmarble> do I have to like, check the pid inside of there?
<Papierkorb_> what is the problem?
<FromGitter> <Sevensidedmarble> that function gets called when the program receives SIGINT, and it should kill the process in Jobs.manager.fg
<FromGitter> <Sevensidedmarble> but its just behaving very strangely.
<Papierkorb_> <Insert random vague answer here>
<FromGitter> <Sevensidedmarble> if you run the shell, and run a command that waits like 'man ls', then hit ctrl c to send SIGINT, something happens but not what I expect
<FromGitter> <Sevensidedmarble> it doesnt end the process, but then whenever you type its like stdin is going to both processes
<FromGitter> <Sevensidedmarble> so I'm doing something wrong but I don't know what
<Papierkorb_> the foreground process can handle signals as it wants
<Papierkorb_> hitting ^C in `man ls` doesn't exit either if ran in any other shell
<FromGitter> <Sevensidedmarble> well shit you're right
<FromGitter> <Sevensidedmarble> I dont know why I thought it did
<FromGitter> <Sevensidedmarble> well my main concern is trapping SIGSTOP then
<FromGitter> <Sevensidedmarble> I don't know what I was thinking there lol
<FromGitter> <Sevensidedmarble> thank you that helped lol
alex`` has quit [Quit: WeeChat 1.9.1]
sam0x17 has quit [Ping timeout: 248 seconds]
sz0 has joined #crystal-lang
<FromGitter> <Sevensidedmarble> Ok my other dumb question is this then
A124 has quit [Ping timeout: 240 seconds]
<FromGitter> <Sevensidedmarble> If that process is handling it's own signal's then why doesn't ^Z stop it?
<FromGitter> <Sevensidedmarble> I thought when a process receives sigstop it won't Continue until receiving sigcont?
A124 has joined #crystal-lang
<FromGitter> <sdogruyol> @marksiemers unfortunately, I haven't setup a TE server cluster
<FromGitter> <sdogruyol> > how many programs are still out there that are now security disasters because they linked statically to openssl? ⏎ Literally, %99.9 of developers don't care, they're just lazy and don't give a shit about security
<FromGitter> <sdogruyol> @Papierkorb
hightower2 has quit [Ping timeout: 240 seconds]
wontruefree has joined #crystal-lang
<Papierkorb_> sdogruyol, yeah that really sucks :|
Papierkorb_ has quit [Quit: Konversation terminated!]
wontruefree has quit [Ping timeout: 248 seconds]
mark_66 has quit [Quit: Leaving.]
<RX14> is static linking really that popular outside of go?
<RX14> which doesn't even use openssl?
<crystal-gh> [crystal] MakeNowJust opened pull request #5268: Format: work formatter against paren with newline (master...fix/crystal-format/5262-format-paren-newline) https://git.io/vFzx9
<robacarp> I thought I somewhere saw an alternate of `.is_a` that allows the type to be passed as variables instead of constants, but I can't find it in the docs now...am I going crazy?
<oprypin> probably
<oprypin> .class ==
<oprypin> is a pretty bad alternative that workss on vars
<robacarp> well, I guess that works, thanks
<crystal-gh> [crystal] MakeNowJust opened pull request #5269: Add `Set#===` as alias to `Set#includes?` (master...feature/hash/includes-eqeqeq) https://git.io/vFzh6
alibby has joined #crystal-lang
qard has joined #crystal-lang
Hates_ has joined #crystal-lang
<Hates_> If I was to write a small app with Kemal, is it possible to build it as a single binary with all the templates and assets bundled with it?
<FromGitter> <sdogruyol> @RX14 no
<FromGitter> <sdogruyol> @Hates_ yes, you need to use a virtual file system like https://github.com/schovi/baked_file_system
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 250 seconds]
<Hates_> Ahh that's great. thanks :)
<faustinoaq> Interesting language, made using https://github.com/myst-lang/myst, is almost crystal but dynamic :)
<faustinoaq> s/Interesting language, made using/Interesting language made using crystal/
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
flaviodesousa has quit [Remote host closed the connection]
illyohs has joined #crystal-lang
<FromGitter> <sdogruyol> Recently, I've seen a good amount of Go developers boasting "single binary and it just works" without any further thinking...most of them don't care / know about linking at all @RX14
wontruefree has joined #crystal-lang
<RX14> lol
<RX14> well we can't do that
<FromGitter> <sdogruyol> we don't need to
<FromGitter> <sdogruyol> just let them be that way..anyway
<Papierkorb> fixed
<FromGitter> <sdogruyol> what?
<Papierkorb> your === emphasis doesn't get removed and breaks the link
<FromGitter> <sdogruyol> sorry, I'm using Gitter
claudiuinberlin has quit [Ping timeout: 248 seconds]
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
<FromGitter> <faultyserver> Thanks for the shoutout for Myst :)
wontruefree has quit [Ping timeout: 250 seconds]
<FromGitter> <sdogruyol> @faultyserver good job
<FromGitter> <sdogruyol> it looks pretty well done
<FromGitter> <faultyserver> thanks :) I still kinda feel like I'm in over my head, but it's been a fun journey so far
<FromGitter> <sdogruyol> would like to have a guest blog post from you on Crystal website @faultyserver :)
<FromGitter> <faultyserver> oh man, that'd be pretty neat..............and scary
<FromGitter> <sdogruyol> no, not scary :P
<FromGitter> <faultyserver> I mean, I'd love to, but I'm not really sure what I'd write on exactly
<FromGitter> <sdogruyol> this might give you some idea https://crystal-lang.org/2017/01/06/the-charly-programming-language.html
edo has joined #crystal-lang
<edo> hello, can someone help me?
<FromGitter> <faultyserver> man, I remember reading that post when it was published. Was honestly a lot of the inspiration for me to get started
<FromGitter> <faultyserver> ===edo, probably :)===
<edo> ok, I use Linux (Solus) and I installed Crystal from source, I also downloaded shards but when I try to compile a project it says "Error in file.cr:1: while requiring "prelude""
<edo> it says also "in /home/edoardo/crystal/src/prelude.cr:15: while requiring "exception""
vivus has joined #crystal-lang
<edo> in /home/edoardo/crystal/src/exception.cr:1: while requiring "callstack"
<edo> in /home/edoardo/crystal/src/callstack.cr:1: while requiring "c/dlfcn": can't find file 'c/dlfcn' relative to '/home/edoardo/crystal/src'
<edo> what should I do?
<jhass> you probably have to generate the bindings for your architecture
<jhass> to see some examples
<FromGitter> <bramhaag> Hey, I was wondering if there's a way in Crystal to do one line if statements and methods like you can in Elixir. For example: `if some_condition, do: x` and `def method, do: xyz`
<FromGitter> <faultyserver> if statements can be used as a suffix: `do_x if some_condition`
<FromGitter> <faultyserver> methods, just use a semicolon as the delimiter instead of newlines: `def method; xyz; end`
<FromGitter> <bramhaag> ah alright, thanks!
<FromGitter> <faultyserver> (you could do ifs the same way `if some_condition; do_x; end`, but that's not as clean most of the time)
<FromGitter> <faultyserver> pretty much anywhere a newline is used, it can be replaced with a semi-colon instead
<FromGitter> <bramhaag> isn't that considered a bad practice though?
<FromGitter> <bramhaag> `def method; xyz; end` does look pretty weird imo
<FromGitter> <faultyserver> it's generally avoided, yeah
<FromGitter> <faultyserver> the formatter will change it to be multiple lines
<FromGitter> <faultyserver> imo it's useful when you have a lot of similar, one-line methods, but that's about it
<FromGitter> <unreadable> Just found a Nim gui lib with a very nice API https://github.com/trustable-code/NiGui
<Papierkorb> bramhaag, such really-short methods without logic on their own are kinda rare
<Papierkorb> Thank god, another GUI toolkit
<Papierkorb> ah ok, it uses .. Gtk .. meh
<FromGitter> <unreadable> what's wrong with gtk 😄
<FromGitter> <unreadable> It's native look
<Papierkorb> No it's not
<Papierkorb> Gtk is portable in the sense of the word: It compiles
<Papierkorb> It's not really good at getting a native look n feel
wontruefree has joined #crystal-lang
<Papierkorb> And yes, look and feel. If something looks the part, but doesn't act the part, it's not native. Actually the feel part is more important in the end
<FromGitter> <unreadable> the api feels like html tbh
<FromGitter> <unreadable> import nigui ⏎ ⏎ app.init() ⏎ var window = newWindow() ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5a04b401e44c43700ada847a]
<Papierkorb> That's a bog standard GUI API?
<FromGitter> <unreadable> bog?
sam0x17 has joined #crystal-lang
<Papierkorb> https://github.com/Papierkorb/qt5.cr/blob/master/samples/hello_world.cr Compare it to Qt5s API (I mirror most of it)
<FromGitter> <unreadable> didn't get it, however it seems it takes very few memory for the binaries
<faustinoaq> ‎Papierkorb, ...It uses a preprocessor for the C++ code, therefore it cannot be used with other programming languages like C or Nim...
<faustinoaq> Is that true?
<FromGitter> <unreadable> qt5, meh
<Papierkorb> faustinoaq: Well, I do it without one, so they're wrong
<oprypin> edo, but someone else said they were running on solus just fine, so i doubt what jhass said is right
<faustinoaq> :)
<FromGitter> <unreadable> forgot to mentions, it wraps the windows api to get native look as well
<Papierkorb> faustinoaq: It's a common misconception that Qt5 isn't "C++ anymore". The pre-processor step generates additional files, your hand-written C++ files are not messed with in any shape or form
<FromGitter> <unreadable> yep, I'm on solus and had no issues
<faustinoaq> @unreadable, I'm on Manjaro KDE and Qt5.cr works just fine :D
<oprypin> what's "meh" about it
<Papierkorb> faustinoaq: And claiming this to be the case and thus it not being able to be interfaced from other languages is not only wrong because there are plenty language bindings for Qt, but makes me question their lacking research prior. The issue isn't they're not using Qt, it's that their statement is factually wrong. Not saying anything on Qt would've been a better choice.
<Papierkorb> Qt5.cr should work "just fine" at this point on most commonly used linux distributions at this point OOTB, without having to manually generate bindings
<faustinoaq> ‎Papierkorb, even WIndows?
<Papierkorb> "linux distros"
<Papierkorb> gcds got it to work on Mac OS too earlier this week, though I'm waiting on a PR for that
<Papierkorb> Windows will only be of actual interest once the compiler can produce windows binaries without too much of a mess
<faustinoaq> ‎Papierkorb‎, ^OK, Yeah I mean in the future, when crystal on windows become reality :)
<Papierkorb> Sure, would be a shame if not
<Papierkorb> Never got around to using BSD, though that would also be cool to have
<oprypin> Papierkorb, btw is the c++ binding code statically linked into the crystal binary?
<Papierkorb> Yes
<oprypin> do you have any plans for supporting docstrings?
<Papierkorb> you mean pulling out in-source docs from the wrapped C/++ code?
<oprypin> yes
illyohs has quit [Remote host closed the connection]
<Papierkorb> would be kinda nice, but nothing I'm looking to do in the next week.
<Papierkorb> It'd need to support at least doxygen and qdoc (which is almost doxygen) style formatting, to replace function names and stuff
<oprypin> just thinking about what kind of benefits i might lose if switching sfml bindings to use this stuff
<oprypin> ayy sfml uses doxygen
<Papierkorb> "Using \c NULL" -> "Using `nil`" and friends
<Papierkorb> But it gets kinda complex quick. Many libs (... Qt) have their in-source docs in the sources, not in the headers
<Papierkorb> So suddenly, you need to find those for some libs (As in, get a path to it)
<oprypin> (warning: not suitable for all audiences^)
<Papierkorb> Yeah um, something more robust than tons of regex #gsubs :^)
<Papierkorb> Pluggable and everything. At some point, someone may want to add this crazy XML-mess C# style in-source docs thing
<Papierkorb> // <summary>
<Papierkorb> /// <summary>
<Papierkorb> Can't make this up ^
Hates_ has quit [Quit: Connection closed for inactivity]
<FromGitter> <Rinkana> Is there a way for C bindings to return their value instead of the given pointer? Lets say i have this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Can i let `Foo.area` return the actual struct instead of the pointer? [https://gitter.im/crystal-lang/crystal?at=5a04b957f257ad9109759ba3]
<Papierkorb> man I want ioctl() in the stdlib
<Papierkorb> Rinkana, no. Use a wrapper method.
illyohs has joined #crystal-lang
illyohs has quit [Client Quit]
<FromGitter> <unreadable> what's meh about qt? distributing the apps
<Papierkorb> ... And gtk is easy to distribute?
illyohs has joined #crystal-lang
<FromGitter> <unreadable> well, I got out 1 stand alone binary
<Papierkorb> you can too with Qt
illyohs has quit [Client Quit]
<FromGitter> <unreadable> Only if u got a license
<Papierkorb> no?
<Papierkorb> Ever read the LGPL?
illyohs has joined #crystal-lang
<FromGitter> <sdogruyol> I don't get it
<FromGitter> <sdogruyol> why should it be easier than gtk at first @unreadable ?
<Papierkorb> also, what license is GTK under?
<FromGitter> <unreadable> There's something that has to deal with linking
<Papierkorb> The LGPL
<Papierkorb> So the same
<FromGitter> <unreadable> hmm, so you're telling me that qt and gtk has the same license? Thought that gtk is something like mit
<Papierkorb> ... what?!
<Papierkorb> Never ever
<Papierkorb> This craze for crappy OSS licenses is quite young
<FromGitter> <unreadable> good.. still waiting for a good cross platform opengl mit licensed gui lib though
<Papierkorb> build one?
<FromGitter> <unreadable> if anyone knows one, hit me up
<FromGitter> <sdogruyol> I just tried some samples from qt5.cr and it's perfect @Papierkorb
<FromGitter> <unreadable> I've really tried, but I still need to improve my c++ knowledge before that
<Papierkorb> thanks <3
<FromGitter> <unreadable> there's also https://github.com/vurtun/nuklear
<FromGitter> <unreadable> and https://github.com/wjakob/nanogui too, but failed building too many times..
sam0x17 has quit [Ping timeout: 248 seconds]
<FromGitter> <unreadable> gonna give qt an in more depth try
<FromGitter> <Rinkana> You could re-write one of the nuklear bindings to Crystal
<FromGitter> <Rinkana> They seem very straight-forward
<FromGitter> <unreadable> or use libgen to generate it, nuklear is completly deps free
<oprypin> why tho
<oprypin> when u have best bindings to the best lib
<FromGitter> <unreadable> @faustinoaq `I think I can create a OSX VM on VirtualBox (I know is quite illegal but hey I don't have a Mac 😅 )` lol
<wmoxam> Just use good 'ol Motif
<wmoxam> the standard widget toolkit for Unix
<oprypin> not even funny
<wmoxam> Who said I was joking????
<wmoxam> 😂
<Papierkorb> OP delivered!
<Papierkorb> what a time to be alive
<FromGitter> <unreadable> looks like windows 98
<FromGitter> <Sevensidedmarble> Hey @Papierkorb, I wanted to ask you since you seem to know a lot about linux, would the terminal not being in raw mode explain why I don't see any SIGSTOP signals in my child processes?
<oprypin> no
<Papierkorb> Terminal behaviour is kinda outta my reach too, but that part shouldn't
<wmoxam> it's beautiful
<Papierkorb> That's material design before it was hip!
<oprypin> Sevensidedmarble‎, stop signal is not supposed to be seen. as far as i understand, it's special, uninterceptible, the process just gets insta-frozen
<wmoxam> Way ahead of its time
<oprypin> still not funny btw
<RX14> that beautiful font rendering
<RX14> wow
<Papierkorb> SIGSTOP cant be caught iirc, but the parent process is notified (or can be)
<RX14> my eyes hurt
<FromGitter> <unreadable> who needs gui when you code zsh
<wmoxam> What's wrong with the font rendering? Anti-aliased and everythign
<Papierkorb> Oh yeah zsh
<Papierkorb> Fancyline supports multiline prompts as of today
<Papierkorb> so take that
<wmoxam> oprypin: EFL is bsd licenced btw
<FromGitter> <Sevensidedmarble> In my tests it just doesn't seem to work
<oprypin> Sevensidedmarble‎, are you even reading the responses
<wmoxam> I find it confusing to work with though
<RX14> EFL is very...
<FromGitter> <Sevensidedmarble> If I run 'find /' and hit ctrl c it stops but ctrl z does nothing
<RX14> interesting
<RX14> my terminal is terminology
<RX14> which is EFL-based
<RX14> and it's a very interesting terminal
<RX14> given you can cat video files and it will play the videos in the terminal
<FromGitter> <Sevensidedmarble> I see what you said yeah
<wmoxam> I haven't had much luck with it ... EFL devs are very Linux centric
<RX14> im not surprised
<FromGitter> <Sevensidedmarble> My linux knowledge is just a little lacking I suppose
alex`` has joined #crystal-lang
<oprypin> @bararchy, any way to get the current weights of neurons in fann?
<FromGitter> <marksiemers> @RX14 - For the TFB, crystal is set to run on port 8080 while both kemal and amber are set to port 3000. Can you think of any reason that would cause a slowdown? Maybe port 3000 conflicts with another service.
<oprypin> that's nonsense
<FromGitter> <marksiemers> The whole scenario feels like nonsense - so I'm just looking for any possible difference.
<oprypin> it is not possible for two processes to listen one port simultaneously, and any other kind of conflict is not possible
<RX14> well it is oprypin
<RX14> because we bind with reuse_port
<FromGitter> <marksiemers> Is it possible that port 3000 could be throttled, but 8080 is not?
<RX14> the other process would need to be reuse_port too
<RX14> but it could happen
<FromGitter> <marksiemers> It is an easy enough change - I just want a way to get a feedback loop without having the TE guys have to do a run for us
<RX14> they dont have to do a run
<RX14> they can run individual benchmarks whenever they want
<RX14> we just need to ask them
<oprypin> i
<oprypin> i'm so frustrated right now
<RX14> why so?
<oprypin> i want to write multiple iterators and i'm forced to make those methods that manually accumulate array values
<FromGitter> <marksiemers> Sure - I just want to isolate some changes (db connection pool, port, GC_MARKERS) - asking them over and over seem onerous.
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <marksiemers> Maybe I can just give them a handful of branches or commits and ask them to run a few.
qard has joined #crystal-lang
<RX14> they have an IRC channel where you can talk to them live you know
<crystal-gh> [crystal] RX14 closed pull request #5268: Format: work formatter against paren with newline (master...fix/crystal-format/5262-format-paren-newline) https://git.io/vFzx9
<oprypin> the formatter is being a waste of time, who would've thought
<FromGitter> <marksiemers> ===TechEmpower ?===
<Papierkorb> where do these === come from?
<oprypin> yeah was gonna ask
<Papierkorb> I don't even see them in the gitter
<RX14> oprypin, what do you mean?
<oprypin> ‎@marksiemers‎, how did you write that last message? anything special? it comes out as `===TechEmpower ?===` in the IRC bridge
<Papierkorb> sdogruyol also had a message like that some hours ago
<oprypin> i think it's when the message starts with `#` but why does it not affect anything in gitter?
<FromGitter> <marksiemers> I accidentally did the markdown syntax for an h1
<oprypin> did you ninja edit that?
<FromGitter> <marksiemers> sorry if it blew up the font size
<Papierkorb> Why does gitter even support headings..?
<oprypin> no idea
<RX14> lol
<Papierkorb> Well, whatever. the bot could silently discard such heading stuff
<RX14> just do `# `
<RX14> it's short and sweet
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<FromGitter> <marksiemers> I did ninja edit in gitter what I originally typed was `#TechEmpower` then I tried `# TechEmpower` ⏎ Both created an h1 in gitter
<oprypin> needs `\#`
<oprypin> honestly a fail on gitter's part, who would ever type a header without a space after #
<oprypin> or markdown's part
<edo> how can I generate bindings of crystal?
<Papierkorb> who would ever want a huge text like that in a chat
<edo> how can I generate bindings of crystal?
<Papierkorb> ..?
<edo> how can I generate bindings of crystal for my architecture?
<travis-ci> crystal-lang/crystal#b9ea898 (master - Format: work formatter against paren with newline (#5268)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/299884778
<DeBot_> https://github.com/crystal-lang/crystal/pull/5268 (Format: work formatter against paren with newline)
<RX14> edo, you mean port crystal? bindings of a C library in crystal?
<RX14> please more context/information
<edo> my problem: I use Linux (Solus) and I installed Crystal from source, I also downloaded shards but when I try to compile a project it says "Error in file.cr:1: while requiring "prelude""
<edo> it says also "in /home/edoardo/crystal/src/prelude.cr:15: while requiring "exception""
<edo> in /home/edoardo/crystal/src/exception.cr:1: while requiring "callstack"
<edo> in /home/edoardo/crystal/src/callstack.cr:1: while requiring "c/dlfcn": can't find file 'c/dlfcn' relative to '/home/edoardo/crystal/src'
<RX14> oh god stop
<edo> what should I do?
<RX14> pastebin please
<RX14> gist.github.com
<RX14> or similar
<RX14> next time please tell us the root problem, not your abstract interpretation of it
<RX14> "how can i generate bindings" is much less useful than a concrete error message
<faustinoaq> "Error in file.cr:1: while requiring "prelude"" edo, I saw this error before, You need to set `CRYSTAL_PATH=lib:/path/to/source/code`
<edo> ok, when I try to compile also a simple program like Hello World it says the same error messages, like if it can't require libraries
<RX14> no faustinoaq
<RX14> this is different
<RX14> "error while requiring prelude" is a massively generic error
<faustinoaq> RX14, Ok :) no problem
<RX14> edo, what does `gcc -v` tell you
<RX14> and pastebin or similar please, don't paste in irc
<FromGitter> <Qwerp-Derp> Is anyone on with Mac OS X expertise with compiling binaries? I need to compile a binary with dylibs from CrSFML as well as from Crystal itself, and I want to make it as stand-alone as possible. I honestly have no idea what to do - if you’re willing to help, PM me and I’ll send you my project, as well as whatever else you need to make the binary as stand-alone as possible.
<RX14> so they're using a custom triple
<edo> custom triple?
<RX14> it's a linux distribution why is solus using it's own target triple
<edo> i don't know
<Papierkorb> (whatever happens, please not another compiler :flag)
<RX14> ofc
<RX14> you just tell it the true triple
<RX14> not whatever the solus guys have fucked up
<RX14> edo, use the --target x86_64-linux-gnu crystal compiler flag
<edo> I don't understand
<edo> oh ok
<RX14> and it should work
<RX14> edo, that was just me ranting
<RX14> you can pretty much ignore it
<RX14> Papierkorb, we *need* to bind LLVM's target normalization
<RX14> it's available to C++, we just need to bind it to C and write a PR which normalizes target triples before using them
<Papierkorb> mh?
<Papierkorb> oh that
<RX14> so we have the full triple
<RX14> the full triple with all 4 elements
<Papierkorb> good triple
<RX14> which just tells you exactly how much technical debt there is in all this
<RX14> i should get off irc and take a nap because i'm not in a good mood
wontruefree has quit [Ping timeout: 268 seconds]
<edo> ehm... if I execute `crystal playground.cr --target x86_64-linux-gnu` it says "Error: Invalid option: --target"
<RX14> yeah well thats unfortunately not going to work
<edo> and... what will I do?
<RX14> the only solution is to rebuild the crystal compiler, setting CRYSTAL_CONFIG_TARGET=x86_64-linux-gnu at compile time
<RX14> reminder: this is all because solus sucks
<oprypin> ayy
<RX14> first you have to clone the crystal github repo
<RX14> then run `CRYSTAL_CONFIG_TARGET=x86_64-linux-gnu make cryatal` inside there
<edo> wait, I delete the crystal folder
<RX14> where did that come from
<edo> what? the folder?
<RX14> then cd crystal
<RX14> then run that command
<edo> yea, I'm cloning
<RX14> dont touch your existing crystal folder
<RX14> oh wait a sec
<RX14> you really want to git checkout 0.23.1 when you're inside the repo
<RX14> oh actually that wont work
<RX14> since CRYSTAL_CONFIG_TARGET isn't inside 0.23.1
<RX14> so ignore me
<RX14> use master
<edo> I have to delete the crystal installation folder because it will be substituted with the new one
<RX14> no
<RX14> you do not
<RX14> you need the old crystal to build the new crystal
<RX14> because crystal is written in crystal
<edo> yea but there are the binaries inside the new crystal
<RX14> yes
<edo> no wait, I can download them from tar.gz
<RX14> what
<edo> I download the binaries with the .tar.gz package and I compile the source with them
<RX14> you have a crystal compiler
<RX14> because you were using it
<oprypin> edo, cant you just use the downloaded tar gz for everything
<RX14> thats all you need
<RX14> oprypin, ???
<RX14> no because thats broken too
<RX14> oh actually
<edo> no, I can't compile anything with the compiler that I had
<RX14> edo, where did you get the compiler
<edo> here is the link
<RX14> oprypin, well somehow LLVM.default_target_triple is returning solus's custom triple from the omnibus
<RX14> thanks edo
<RX14> thats what i expected
<oprypin> RX14, yeah but that does not affect the prebuilt release
<RX14> well the evidence to the contrary is right above you in IRC
<oprypin> and omnibus is not involved, is it
<RX14> he's using the omnibus and it's broken
<RX14> what are you saying I don't understand
<edo> I cloned the repo, now I have to compile it with the tar.gz binary right?
<RX14> yep edo
<edo> but I have to use clang right?
<RX14> no
<edo> oh, that's fine
<RX14> actually make crystal will fail won't it
<RX14> you need to run make crystal, it'll fail
<RX14> then find the crystal command it prints just before it fails
<RX14> it'll have "./bin/crystal ... src/compiler/crystal.cr" in it
<RX14> and then copy that, add CRYSTAL_CONFIG_TARGET=x86_64-linux-gnu to the start of the command , and add --target x86_64-linux-gnu to the end of the command
<edo> https://pastebin.com/JKfdcbrx this is make without clang
<oprypin> meanwhile, @unshadow says it works just fine
<oprypin> woops, i meant @unreadable
<RX14> edo, uninstall solus
<RX14> its the only hope
<edo> but with clang it works
<Papierkorb> this is getting better by the minute
<RX14> if only I could be bothred to sign up to the solus mailinglists just to get banned
<RX14> solus, judged from this interation only, seems to have changed and broken everything, just because NIH
<oprypin> so good to live in times when good distros can be counted on fingers of one hand
sdf_ has joined #crystal-lang
<oprypin> you'd hope that people would stop using the bad ones, eliminating fragmentation, but nope
<RX14> well you can definitely count to 1 on one hand
sdf_ has quit [Client Quit]
<oprypin> lul
<RX14> i should just give up and use arch for everything
<oprypin> dang, i just managed to ctrl+c during compilation in a way that broke consequent compilation attempts
<RX14> yeah that needs to be fixed
<RX14> we need to do the good old tempfile+atomic mv trick
<FromGitter> <drosehn> Might need to remove what's inside the `~/.cache/crystal/` directory.
<oprypin> oh i know. and i have it in /tmp/
<oprypin> (as everyone should)
<RX14> not really
<RX14> ideally it'd work
edo has quit [Ping timeout: 260 seconds]
<hightower3> Can I set a constant in runtime?
<RX14> yes but only once
<RX14> because its constant
<RX14> just put whatever you want on te right hand side of a constant
<RX14> it can be a method call
<RX14> or just a begin/end block
<faustinoaq> I laughed so hard reading the above messages XD
<faustinoaq> ‎oprypin, ...so good to live in times when good distros can be counted on fingers of one hand... What do you think about Manjaro?
<oprypin> faustinoaq, i think it's Arch + horrible bloat
<faustinoaq> XD
<oprypin> the worse part is, of course, delayed updates and worse security
<hightower3> RX14, I get Syntax error in file:137: dynamic constant assignment
<oprypin> hightower3, it has to be a top level assignment, and it happens at the very start of your program
<RX14> well you cant set a constant in a method
<oprypin> you cannot set it in the middle of execution of the program, if that's what is meant by "at runtime"
<hightower3> yes
<hightower3> ok, thanks