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
<FromGitter> <asterite> Also abort
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <asterite> Ah, that's abort... The link is too long :-P
<FromGitter> <vonKingsley> The main fiber in my app does some polling in a loop to an external device, every few seconds. I'm trying to exit my app by trapping ctrl-C and run a few shutdown options such as letting the device know to stop, closeing another program, and a few other tasks. I don't know if I'll correctly explain this, but since Signal.trap runs in its own fiber, it starts on the first task then it seems to release back
<FromGitter> ... to the main fiber after the first method is called (which is basically a Process.run). Is there a way I can have the Signal.trap run through all the tasks then exit, and not release the fiber back to the main fiber?
<oprypin> vonKingsley‎, if you trap the signal, it will no longer cause the program to close, so you should do that yourself. also note that you call trap only once because it overrides (not adds to) previous calls
<oprypin> vonKingsley‎, also you should probably be using at_exit in the first place
<FromGitter> <vonKingsley> @oprypin i try to exit from trap the problem is the main fiber takes over again during some of my cleanup tasks, but I'll take a look at at_exit and see if that helps
<oprypin> vonKingsley, it's true that what you're saying can happen, and that really sucks
<FromGitter> <vonKingsley> @oprypin thanks for confirming that this can actually happen. i'll work with at_exit - appreciate the help
<oprypin> i give about 30% chance that at_exit will not have this problem
<FromGitter> <vonKingsley> worse case scenario I think I can pass off to another crystal program at exit to do the clean up
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 250 seconds]
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<RX14> >> (uninitialized UInt8[1])[1000]
<DeBot_> RX14: - https://carc.in/#/r/31zh
<RX14> nvm
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
vivus has quit [Quit: Leaving]
Fraggle has quit [Quit: Page closed]
RickHull has joined #crystal-lang
illyohs has joined #crystal-lang
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
rohitpaulk has joined #crystal-lang
woodruffw has joined #crystal-lang
csmrfx is now known as c-c
rohitpaulk has quit [Ping timeout: 268 seconds]
RickHull has quit [Quit: Page closed]
<FromGitter> <Rinkana> Morning
rohitpaulk has joined #crystal-lang
Papierkorb_ has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
flaviodesousa has joined #crystal-lang
alex`` has joined #crystal-lang
alex`` has quit [Client Quit]
alex`` has joined #crystal-lang
livcd has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
mark_66 has joined #crystal-lang
alex`` has joined #crystal-lang
claudiuinberlin has quit [Ping timeout: 268 seconds]
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 250 seconds]
rohitpaulk has joined #crystal-lang
alex`` has quit [*.net *.split]
TheGillies has quit [*.net *.split]
ephemera_ has quit [*.net *.split]
avdi has quit [*.net *.split]
hmans has quit [*.net *.split]
aemadrid has quit [*.net *.split]
A124 has quit [*.net *.split]
salvor has quit [*.net *.split]
fiete has quit [*.net *.split]
andersh has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
jokke has quit [*.net *.split]
handicraftsman has quit [*.net *.split]
tliff has quit [*.net *.split]
jhass has quit [*.net *.split]
aarongodin has quit [*.net *.split]
mroth has quit [*.net *.split]
danzilio has quit [*.net *.split]
A124 has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
FromGitter has quit [Ping timeout: 250 seconds]
byteflame has quit [Ping timeout: 240 seconds]
weston_[m] has quit [Ping timeout: 258 seconds]
sija[m] has quit [Ping timeout: 248 seconds]
kp666[m] has quit [Ping timeout: 250 seconds]
olbat[m] has quit [Ping timeout: 248 seconds]
Renich has quit [Ping timeout: 248 seconds]
braidn[m] has quit [Ping timeout: 240 seconds]
watzon has quit [Ping timeout: 250 seconds]
tybee[m] has quit [Ping timeout: 255 seconds]
thelonelyghost has quit [Ping timeout: 255 seconds]
cptaffe has quit [Ping timeout: 250 seconds]
dtcristo has quit [Ping timeout: 264 seconds]
ephemera_ has joined #crystal-lang
avdi has joined #crystal-lang
hmans has joined #crystal-lang
alex`` has joined #crystal-lang
salvor has joined #crystal-lang
daemonwrangler has joined #crystal-lang
handicraftsman has joined #crystal-lang
fiete has joined #crystal-lang
tliff has joined #crystal-lang
andersh has joined #crystal-lang
mroth has joined #crystal-lang
jhass has joined #crystal-lang
aemadrid has joined #crystal-lang
aarongodin has joined #crystal-lang
jokke has joined #crystal-lang
danzilio has joined #crystal-lang
handicraftsman has quit [Quit: Blame ZNC]
handicutsman has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Client Quit]
olbat[m] has joined #crystal-lang
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<faustinoaq> Morning :)
tybee[m] has joined #crystal-lang
byteflame has joined #crystal-lang
kp666[m] has joined #crystal-lang
braidn[m] has joined #crystal-lang
TheGillies has joined #crystal-lang
Renich has joined #crystal-lang
cptaffe has joined #crystal-lang
thelonelyghost has joined #crystal-lang
dtcristo has joined #crystal-lang
watzon has joined #crystal-lang
weston_[m] has joined #crystal-lang
sija[m] has joined #crystal-lang
<jokke> hi
<jokke> is there no format() method in crystal?
<FromGitter> <bew> to do what?
<jokke> something like format("something %{foo}", foo: "bar") # => "something bar"
<jokke> or better yet format("something %<foo>s", foo: "bar")
<Papierkorb_> string interpolation?
<jokke> "something %<foo>s" is read at runtime
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vF02S
<crystal-gh> crystal/master 060f404 TSUYUSATO Kitsune: Doc: escape string array litral as HTML to prevent XSS
<jokke> so not an option
<Papierkorb_> No, use a (small) templating engine
<jokke> mmh
<jokke> this would be very easy to integrate into stdlib
<jokke> it's basically just a wrapper around sprintf
<Papierkorb_> Oh god no
<Papierkorb_> NOOOOO
<jokke> hm?
<Papierkorb_> sprintf is a security risk, and isn't Crystal native (what most people would expect)
<jokke> kk
<Yxhvd> There is https://crystal-lang.org/api/0.21.0/String.html#%25%28other%29-instance-method .
<Yxhvd> (I wish the latest were better at showing up in the search results - it is still there in .23)
<Papierkorb_> `#sprintf` looks to be memory safe
<Papierkorb_> Mh although `#sprintf` shouldn't be a global function. Really dislike that part. Barely a method has a right to be global
<travis-ci> crystal-lang/crystal#060f404 (master - Doc: escape string array litral as HTML to prevent XSS): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/299034141
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
<RX14> i've never used crystal printf lol
<RX14> not in real code
<Papierkorb_> Me neither, though I see the point of using it as a simple 'template engine'
<Papierkorb_> As long it's safe, nothing much wrong with it
<RX14> yeah
<RX14> i tend not to use formatting numbers much
<RX14> which is where i mainly see it's use
<FromGitter> <codenoid> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a02ebdc7081b66876c57b20]
<FromGitter> <codenoid> with `--release --no-debug` , but working with `crystal run myapp.cr`
alex`` has quit [Ping timeout: 252 seconds]
alibby1 has joined #crystal-lang
<faustinoaq> Hi IRC users on #crystal-lang community, #amber framework channel is now available with FromGitter bot thanks to oprypin.
<faustinoaq> If you like, take a look on #amber :)
hightower2 has joined #crystal-lang
<hightower2> Hey, I'm using crystal-pg and am running some SAL queries with arguments $1, $2 etc. How do I make sure that the params I provide are properly escaped/quoted etc.? Is there a ready made function for that?
<hightower2> SQL even :)
<jokke> wow i just realized i have no chance parsing emails in crystal or any other language
<jokke> not sure if it's isync's fault or my email server or what but there are no CRNL in the mails. only NL
<jokke> that wouldn't be a problem itself, but header values contain newlines as well \o/
<faustinoaq> ‎hightower2‎, As far as I know, the `$1` syntax on Postgres and `?` on MySQL implemented by crystal-db already escape the parameters provided on exec command.
<faustinoaq> ‎hightower2‎, see: https://crystal-lang.org/docs/database/#exec
<hightower2> faustinoaq, right, $1, but how do I make sure that the input I pass is properly escaped
<hightower2> faustinoaq, (seems that the doc implies this is done automatically)
<faustinoaq> ‎hightower2, doing a spec?
<hightower2> Just want to make sure no rogue input is allowed
<faustinoaq> ‎hightower2‎, see: https://github.com/will/crystal-pg/blob/master/spec/pg/escape_helper_spec.cr, try to modify it according to your needs.
<hightower2> faustinoaq, ++, just what I needed, thanks
handicutsman is now known as handicraftsman
<oprypin> hightower2, if you're using a database, you are meant to think that the wrapper is doing the right thing and always escaping - the only thing to know is don't do your own interpolation!
<oprypin> hightower2, if you're implementing a database wrapper, well... yeah, gotta escape things
<hightower2> ooh ok, great, all clear, thanks
<oprypin> im just guessing though lol
<oprypin> i mean it wouldnt make sense to me any other way
<Papierkorb_> hightower2: RX14 mentioned yesterday that arguments are passed by the driver separate from the query to the DB server, hence, no one needs to escape anything and it's safe
Guest56979 has joined #crystal-lang
<oprypin> yeah the doc matches my assumption
<oprypin> Papierkorb_, that happens for most drivers but i'd assume it's not always possible
<hightower2> ++
<Papierkorb_> oprypin: Then that driver/DB is awful
<Papierkorb_> variables are variables, not language constructors. Stuff like `SELECT * FROM ?` isn't possible with any DB I know of
<Papierkorb_> And if you want to allow that, I think you have other issues than escaping lol
<Papierkorb_> oprypin: I just said what RX told me, I haven't checked myself
<RX14> oprypin, i don't know
<RX14> i assume it might be used when you want to do dynamic query building
<RX14> for example in an ORM
<RX14> idk
<Papierkorb_> ... Let's hope an ORM doesn't do that
<RX14> well
<RX14> perhaps for escaping table names in an ORM?
<oprypin> thats not how you escape table names though
<hightower2> there is escape_literal and escape_identifier
<oprypin> yeah escape_identifier is
<oprypin> well maybe escape_literal is just for completeness' sake
Guest56979 has quit [Quit: quit from client]
d1rewolf has quit [Ping timeout: 255 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
<oprypin> i brought this up a year ago and got a satisfactory answer, but I'm still not sold on GCs, I just hate them
<oprypin> with CSP being the concurrency model, doesn't reference counting become viable?
<faustinoaq> What about making the GC customizable like Nim?
<crystal-gh> [crystal] Sija opened pull request #5261: Add Crystal::Environment module (master...feature/crystal-environment) https://git.io/vFEmo
<faustinoaq> What would be the result for Crystal [here](https://gist.github.com/dom96/77b32e36b62377b2e7cadf09575b8883)?
alex`` has joined #crystal-lang
<Papierkorb_> oprypin: ref counting has the big issue that it doesn't detect loops
<oprypin> not if it's a naive implementation
<oprypin> but Python pulls it off, doesnt it
<Papierkorb_> Python iirc doesn't use ref counting, hasn't for some time
<oprypin> wut
<Papierkorb_> Well then what's the point
<Papierkorb_> If they still require a GC mechanism?
<oprypin> 🤔
<Papierkorb_> The biggest jump would be if the compiler did escape analysis
<Papierkorb_> That should (?) get rid of many temporary arrays and friends, freeing the GC a lot
<Papierkorb_> (Oh yeah I'm totally guessing ^)
<oprypin> so does python do reference counting only to make destructors work or something silly like that
<oprypin> seems to me like reference counting can be a primitive alternative to escape analysis
<Papierkorb_> but is it worth it?
<oprypin> probably not :/
alibby1 has quit [Quit: Leaving.]
Papierkorb_ has quit [Quit: Konversation terminated!]
flaviodesousa has quit [Ping timeout: 264 seconds]
mark_66 has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 1.9.1]
hightower4 has joined #crystal-lang
<robacarp> looking at the documentation for Socket, I'm coming up short for connecting an IP socket that isn't a TCP socket. It seems like Socket::IPAddress cannot be constructed without a port number which seem to imply that it's intended only for use with TCP sockets.
<FromGitter> <bew> what kind of socket do you want to connect to?
<robacarp> for example: `sock = IPSocket.new Socket::Family::INET, Socket::Type::DGRAM, Socket::Protocol::ICMP`
<robacarp> then sock.connect seems to want an Address, which I don't see a way to construct without a port
<robacarp> my knowledge of c networking is admittedly weak, so I could be making assumptions I shouldn't be
hightower3 has quit [Ping timeout: 240 seconds]
<oprypin> looks like there's no way to not specify a port in C either
<robacarp> yeah, I was just reading similar stuff over here: http://www.retran.com/beej/syscalls.html#connect
<FromGitter> <bew> If you want to send a ping, it looks like you just need to set it to 0: https://people.eecs.berkeley.edu/~istoica/tmp/i3-stable/i3_client/ping.c
<robacarp> good link, @bew, thanks. I'll try that
claudiuinberlin has joined #crystal-lang
<oprypin> great, now RNG is a trainwreck in a stdlib
<oprypin> no RNG that can be initialized with a number
<oprypin> oh. > Initializes an instance with the given *seed* and *sequence*.
edo has joined #crystal-lang
<edo> anyone online?
<robacarp> lots of people online
<edo> can someone tell me why when I try to compile the Crystal sources it tells me "You need to have a crystal executable in your path!"? If I'm trying to compile it how can I have an executable?
<oprypin> edo, Crystal compiler is implemented using Crystal
<edo> but where can I find the executable? how can I compile crystal?
<edo> here is the situation: I cloned Crystal by git, I run make and it says "You need to have a crystal executable in your path!". Now what can I do?
<oprypin> edo, install a crystal executable and retry running make
<FromGitter> <bew> To build the last compiler you need to have the compiler of the last release
<oprypin> edo, in case it is not clear: to use a program written in Crystal, you need a built Crystal compiler. Crystal compiler is one such Crystal program. so you always need to start from a binary, just soruces are not enough
<edo> I have a crystal executable on macOS, can it be useful for this?
<oprypin> edo, it can be useful for making a newer crystal executable on macOS
<oprypin> if you are trying to run crystal on an entirely new OS you could cross-compile (very advanced) but usually it's easier to install a built compiler for your system
<edo> can be useful to create a virtual machine, putting inside an arch linux based distro, install on the distro by the arch user repository, copy the executable of the virtual machine in the host machine and use it?
<oprypin> edo, under specific circumstances, yes. depends on the host OS
<FromGitter> <unreadable> btw, wouldn't the C version of the compiler be more faster?
<oprypin> unreadable‎, there is no such C version
<edo> host os is Solus https://solus-project.com/
<FromGitter> <unreadable> I'm on solus right now
<FromGitter> <unreadable> oprypin what do you mean
<FromGitter> <unreadable> ?
<FromGitter> <unreadable> Well, I think you got me wrong
<edo> ok, so I download the tar.gz package and I compile the source version? (ln -s [full path to bin/crystal] /usr/local/bin/crystal is for the PATH?)
<FromGitter> <unreadable> Why did they want to write the compiler in crystal instead of c? It's just a tool, the faster the better
<FromGitter> <unreadable> I know what's ur problem edo
<FromGitter> <unreadable> I had the same problem
<FromGitter> <unreadable> you have to put bin/crystal into your $PATH
<edo> yea, that's what I mean
<edo> now i try
<FromGitter> <unreadable> or you can do source/bin/crystal --file
<oprypin> unreadable‎, maybe because C is a terrible programming language not suitable for big projects?
<oprypin> edo, you don't have to use ln
<oprypin> hm maybe you do
<FromGitter> <unreadable> well, if c is a terrible language, I guess all the languages are
<FromGitter> <unreadable> maybe not c, but modern c++ is definetly enjoyable
<oprypin> in a sense yes but at least you can get things done within a finite amount of time
<oprypin> edo, `export PATH="$PATH:/full/path/to/downloaded/crystal/bin/crystal"` is the alternative to link
<oprypin> export PATH="$PATH:/full/path/to/downloaded/crystal/bin"
<oprypin> then cd to sources and make
<FromGitter> <drosehn> I'm sure there are many people who do not consider C++ enjoyable, but that's not the issue here. Crystal is written in Crystal because the developers are confident that Crystal (as a language) has all the features needed to do a good job of implementing a computer language. But that has the side-effect of this boot-strapping issue, and that certainly can be a hassle.
<oprypin> unreadable‎, also FYI if the current compiler was exactly rewritten in C, I'd expect about a 5% speedup
<edo> thank you all
<FromGitter> <drosehn> (personally I think it's great that the crystal compiler is written in crystal, once you can get past the hassle of boot-strapping it on some new platform)
<edo> I did it
<FromGitter> <drosehn> 👍
wontruefree has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest86124
Guest86124 has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
edo has quit [Quit: Page closed]
<robacarp> oprypin, @bew: setting the port to 0 works, and I'm seeing ping echo/reply in wireshark now! thanks for helping me sort that out
<robacarp> strange thing now though, I can send ICMP as a regular user, but attempting to receive on that socket throws a permission denied unless I run as sudo
<robacarp> oh...only when wireshark is running.
<robacarp> yeah, something was weird there. wireshark now causes no problems. :|
<FromGitter> <unreadable> trust me man, you can write beautiful c or c++ or whatever language code
<FromGitter> <unreadable> I've seen horible c++ libraries with namespace in namespace in another namespace and so on
<FromGitter> <unreadable> SFML and SDL2 are two libs that have a really clean api
<oprypin> until the c++11 nation attacked
<oprypin> nvm I must be confusing something
<FromGitter> <marksiemers> Is there a way to limit the number of database connections with crystal-db or crystal-pg ?
<FromGitter> <marksiemers> Thanks, in the techempower benchmarks, fasthttp in go-lang limits it to 2x the number of cores. It's something I want to try to see if it improves the db benchmarks for crystal (and frameworks)
<oprypin> holy crab, i just used a neural network in crystal :o
<Papierkorb> ... never ran the nn sample?
<oprypin> there's such a sample?
<oprypin> fed just the data from https://i.imgur.com/GfXGHiS.png into https://github.com/NeuraLegion/crystal-fann and then it quite confidently detected one thing i tried in another image. great work, @bararchy
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #crystal-lang
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
wontruefree has joined #crystal-lang
wontruefree has quit [Ping timeout: 246 seconds]
<FromGitter> <OldhamMade> hey all. is there a way I can check whether a type is an extension of another type? For example, I have a `Crinja::Value` which "underneath" is just a `Bool`. Is there any way I can check that?
Ven_ has quit [Ping timeout: 248 seconds]
<oprypin> OldhamMade‎, usually you'd do this indirectly. let me know your use case
<oprypin> here it should suffice to do `Crinja::Value == Bool`
<oprypin> wait what
<oprypin> it's not an extension of bool though
<FromGitter> <OldhamMade> extension may not be the right word
<FromGitter> <OldhamMade> alias?
<oprypin> it's not an alias, i have no idea what you mean here
<oprypin> anyway, explain what you want to do, i dont get it
Ven has joined #crystal-lang
Ven is now known as Guest53140
<FromGitter> <OldhamMade> the value I have is a Bool, but when I check it with `typeof` I get `Crinja::Value`
<oprypin> ok that's correct, but what do you want to do?
<FromGitter> <OldhamMade> since something that's a Crinja::Value can be a String, Nil, etc, I'd like to know how to check which one it is
<oprypin> that.is_a? String
<FromGitter> <OldhamMade> yep, I get false when I do that :(
<oprypin> Crinja::Value is like a container type. basically `["a"].is_a? String` would also give false
<oprypin> OldhamMade‎, Crinja::Value has a `raw` method that returns a `Type` which is an actual union alias that you can use this on
<FromGitter> <OldhamMade> eg, `typeof(thing) # Crinja::Value`, `thing.is_a?(Bool) # false
<FromGitter> <OldhamMade> cool, thanks, I'll try that
<FromGitter> <OldhamMade> couldn't see that in the docs, nor in the code.
Guest53140 has quit [Ping timeout: 268 seconds]
<FromGitter> <nicck> I'll try last time. Can anybody recommend any solution which I can use from crystal to parse email in `.eml` format? I've tried to find a shard for this but can't find anything useful.
martinium has joined #crystal-lang
<jhass> still young eco system, you can get famous for writing one ;)
<FromGitter> <sdogruyol> @jhass long time no see, how are you
<jhass> fine, thanks :)
<FromGitter> <nicck> ok, thanks! just wanted to make sure I have not missed well known solution.
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> oprypin thanks :) happy you liked it
<FromGitter> <pnloyd> Does Crystal generally produce faster code than other languages that sit on top of llvm?
<oprypin> pnloyd‎, no
<FromGitter> <bararchy> Papierkorb it seems the NN in the samples is a feed forward without back propagation, maybe we can add some meat to it, make it more "modern" , maybe even add RNN capabilities
<FromGitter> <pnloyd> @oprypin, Are they all about the same? Vary depending on the paradigms they use?
<FromGitter> <drosehn> It takes a lot of work to write a compiler. And even more work to figure out all the ways to get llvm to optimize the code produced by the compiler.
<oprypin> pnloyd‎, they're in the same ballpark but crystal has several qualities that make it nicer to use but inherently slower. #1: garbage collection
<oprypin> and yeah, what drosehn said, that kind of work was mostly not done
<FromGitter> <pnloyd> Calling `opt` on the IR that `crystal build --emit=llvm-ir` produces can produce faster code than plain `crystal build` does.
<FromGitter> <drosehn> I've watched some talks where the `swift` developers talked about some of the techniques they used to get the best optimization out of llvm. All of this takes time, and could be done for crystal at a later date.
<FromGitter> <pnloyd> I'm just trying to figure out if there's a language than can compete with crystal for raw performance while still delivery so many nice language features.
<oprypin> pnloyd‎, i assume u tried crystal build --release ?
<FromGitter> <pnloyd> It's faster than `crystal build --release`
<FromGitter> <pnloyd> Maybe by 10%-20%. Possibly because `opt` is not CPU agnostic? I have no idea. But I looked at the crystal source and I see it manually calls some optimization passes for `crystal build --release`. The optimizations `opt` performs must be superior, at least for non CPU agnostic optimizations.
<FromGitter> <pnloyd> And the code I was bench marking is doing lots of math with vectors, so that probably influenced the numbers as well.
vifino has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest76170
vifino has joined #crystal-lang
Guest76170 has quit [Ping timeout: 268 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
martinium has joined #crystal-lang
martinium has quit [Client Quit]
martinium has joined #crystal-lang
martinium has quit [Client Quit]
martinium has joined #crystal-lang
martinium has quit [Client Quit]
martinium has joined #crystal-lang
martinium has quit [Client Quit]
martinium has joined #crystal-lang
<oprypin> how can i force print a list on a single line?
martinium has quit [Client Quit]
wontruefree has joined #crystal-lang
<oprypin> i'm printing an array of 300 tiny numbers, and Crystal very helpfully adds a newline after each one
<FromGitter> <eliasjpr> Can I apply the crystal formatted to ruby code?
<FromGitter> <eliasjpr> .rb extensions
<oprypin> no
<FromGitter> <eliasjpr> K
<FromGitter> <eliasjpr> Thanks you
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <bararchy> oprypin LOL sounds like a data normalization hell hahah array full of -1.0-1.0 ? ;)
Ven has joined #crystal-lang
Ven is now known as Guest54836
<oprypin> bararchy‎, after i did the pixel detection it's just a simple input layer of about 800 neurons and i give them either 0.0 or 1.0
<oprypin> seems like i got 100% accuracy btw
<oprypin> oh so that probably means that the data is not normalized. but whatever, it's very fast anyway
<Papierkorb> Is there a stdlib function that can calculate the real length of a range ending in a negative?
<Papierkorb> the wrap-around stuff?
<oprypin> not sure what you mean
<oprypin> Papierkorb, oh.. i know one place where the code is, at least
<oprypin> but i dont think it's public
<Papierkorb> Yeah I also have probably like 3 implementations of that same thing. Wouldn't Range be a good place for that?
<oprypin> probably
<FromGitter> <bararchy> You mean an Activation function ? Or not related to the nn ?
<oprypin> @bararchy, i dont have any configuration, just basically the default example. just added 1 more hidden layer compared to it
<FromGitter> <bararchy> That's cool :) you can try playing with Cascade network , this way you don't need to figure out activation functions or hidden layers , and the NN will build it for you
Guest54836 has quit [Ping timeout: 268 seconds]
<oprypin> i mean i got 100% success on the first try (845, [845/2, 845/4], 15) so im pretty happy with what i have (and no, i didnt mix checking data with training data)
<oprypin> the things i'm scanning are synthetic, there are only tiny lighting differences between them, so it's obvious why this went so easily
<Papierkorb> Huh, did something regarding integer handling change from 0.23.1 to HEAD?
Ven_ has joined #crystal-lang
<Papierkorb> Mh might be the #hash change
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<RX14> you know you're ready for the core team if you can remember how to spell ysbaddaden right first try
Ven_ has quit [Ping timeout: 248 seconds]
<oprypin> pfft i've always spelled it perfectly for years
<RX14> i always had to look it up for so long
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest31726
Guest31726 has quit [Client Quit]
DTZUZO has joined #crystal-lang
<FromGitter> <unreadable> In the STDlib, is LibC used only for syscalls?
<oprypin> no
<FromGitter> <unreadable> Like?
<oprypin> well there's at least one strlen usage :D
<oprypin> it's harder to find them than i thought
<FromGitter> <unreadable> Or assuming that the syscalls are being done via assembly, would LibC still be needed? Not talking about modules that needs some c libs and so on
<oprypin> you could survive without them, but i dont see why
<FromGitter> <unreadable> LibC is a pretty big dep, pure crystal would be better
<oprypin> unreadable‎, there are a ton of more important things
<FromGitter> <unreadable> Ikr