RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.2 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
bew78 has joined #crystal-lang
onionhammer has quit [Quit: WeeChat 1.0.1]
onionhammer has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ssvb has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
ruby_ has joined #crystal-lang
ruby_ has quit [Ping timeout: 265 seconds]
bew78 has quit [Ping timeout: 244 seconds]
ruby_ has joined #crystal-lang
Oliphaunte has quit []
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
Philpax has quit [Ping timeout: 276 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
phase_ has joined #crystal-lang
ruby_ has quit []
Oliphaunte has joined #crystal-lang
Philpax has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
qard_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
Philpax has quit [Ping timeout: 276 seconds]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <piedoom> does anyone know a good way of playing with a shard lib short of creating a new project to consume it? Can't figure out the best way since Crystal doesn't have a REPL yet.
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
snsei has joined #crystal-lang
<FromGitter> <bcardiff> @piedoom `crystal play` ;-)
<FromGitter> <bcardiff> you will need to create a project with the dependency shard or checkout the shard itself, but the playground covers many of the cases of a REPL
<FromGitter> <piedoom> alright, sounds good
<FromGitter> <helper2424> What about true reflection tool like ruby `pry`?
<FromGitter> <bcardiff> Debugging is not a complete option right now. But ysbaddaden and waj have/are working on that line.
<FromGitter> <helper2424> Oh, it's cool.
<FromGitter> <bcardiff> But actually the documentation tool is built upon "reflection" or checking all possible definitions.
<FromGitter> <bcardiff> If you want reflection to sort of have an autocomplete / discovery of method the documentation could be the way to go.
<FromGitter> <bcardiff> It's might sound not as fancy, but the documentation is another tool. :-)
snsei has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<FromGitter> <raydf> Hi
<FromGitter> <raydf> Is there any way to cast a super class to and inherited one?
DeBot has joined #crystal-lang
qard has joined #crystal-lang
phase_ has quit [Ping timeout: 255 seconds]
Philpax has joined #crystal-lang
mark_66 has joined #crystal-lang
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BlaXpirit> raydf, hm probably not. that doesn't make sense
<BlaXpirit> that object has to be initially created with the inherited class
<FromGitter> <piedoom> I guess what you could do is allow the child class to have a constructor that accepts a type of the parent class and then create the class around that
<FromGitter> <raydf> Thanks for the sugestions
<FromGitter> <raydf> @piedoom self can't be assigned
<FromGitter> <raydf> I was trying to conditionally (based on a property) adding new methods to a super class
<FromGitter> <cjgajard> as said in https://crystal-lang.org/docs/syntax_and_semantics/as.html ⏎ `as` keyword does not transform the object, is a hint/assetion to the compiler type-system ⏎ https://play.crystal-lang.org/#/r/1abe (even if you can cast Child to Parent it is still a Child)
<FromGitter> <raydf> i did it with json parsing child.from_json(super.to_json)
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<FromGitter> <raydf> This is a monkey patch, i'll try to create a better version later.
<FromGitter> <piedoom> You could always do something like this although it's horribly messy ⏎ ⏎ https://play.crystal-lang.org/#/r/1abo
<FromGitter> <piedoom> in reference to my previous comment, rather - this is what I mean
<FromGitter> <raydf> It looks like there's a problem with play.crystal-lang.org
<FromGitter> <piedoom> Is it down?
<FromGitter> <raydf> i can't see the code.
<FromGitter> <piedoom> That's odd.
<BlaXpirit> raydf, is that the same old mysterious bug with firefox?
<BlaXpirit> (was it firefox even?)
<FromGitter> <raydf> Yes i'm using firefox, the page is sending 302
<FromGitter> <raydf> sorry 304 not modified
<FromGitter> <raydf> maybe a kemal bug?
<FromGitter> <raydf> In chrome is working
<BlaXpirit> i dont even think it's kemal
<BlaXpirit> raydf, i think you're on to something with this bug. jhass?
<FromGitter> <piedoom> Is firefox not working for you either? Mine seems fine
<BlaXpirit> no, i never got this bug, but some people randomly do
<FromGitter> <raydf> The bug is related to the meta data it looks maybe use a time token in the url with # link bookmark ?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <raydf> nginx is returning 502
<FromGitter> <raydf> for the hashid
<FromGitter> <raydf> @piedoom, thanks for the example, i needed a a semi deep copy of the super class, so i used json for the moment.
pawnbox has quit [Ping timeout: 255 seconds]
<FromGitter> <raydf> The bug occurs in chrome also.
<FromGitter> <raydf> after reloading the link multiple times.
globalkeith has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bew78 has joined #crystal-lang
sandelius has joined #crystal-lang
sandelius has quit [Client Quit]
bew78 has quit [Ping timeout: 272 seconds]
bew78 has joined #crystal-lang
rtl has quit [Ping timeout: 244 seconds]
Liothen has quit [Ping timeout: 244 seconds]
Liothen has joined #crystal-lang
rtl has joined #crystal-lang
bew78 has quit [Ping timeout: 276 seconds]
soveran has quit [Remote host closed the connection]
<BlaXpirit> i just had an idea for an awesome tool
<BlaXpirit> to detect where in the program a crash happened (most typically segmentation fault)
<BlaXpirit> insert a statement before every statement, then after a crash it will be possible to find out which of these statements was executed last, and so find out where in the source code a crash happened
<BlaXpirit> cuz i sure need one of these right now :(
<BlaXpirit> Invalid memory access (signal 11) at address 0x1 and what do u do
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bew78 has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
trapped has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter> <crisward> Getting what suspiciously looks like a memory leak with a large mariadb query. Process goes to around 1gb of ram and doesn't drop. I've checked using apple instruments and it detects no leaks. So I'm guessing the code is holding references to my rows. Any ideas how to debug this??
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bew78 has quit [Ping timeout: 255 seconds]
bjz has joined #crystal-lang
bew78 has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
pudgy_x has joined #crystal-lang
<pudgy_x> sdogruyal are you there? :)
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
<pudgy_x> somebody here with kemal experience?
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
<BlaXpirit> pudgy_x, you ask a question then wait, not the other way around
<pudgy_x> i did ask a question ???
<pudgy_x> and when it seemed there was no sdog, i asked it more openly
<pudgy_x> you mean to say, i have to wait for sdog, who maybe gone for hours?
<pudgy_x> before i direct my question ?
<FromGitter> <crisward> I've messed with kemal a bit...
<pudgy_x> cisward, have you benched the hello world from kemal?
<FromGitter> <crisward> no, why?
<pudgy_x> on the main page of kemal, sdog displays 100,000 Req/s with wrk
bew78 has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
<pudgy_x> i benched the same hello world with wrk, i am used to benching http, and only get 22000 REQ's
<pudgy_x> this is after building with the release flag and production flag in kemal
<RX14> and logging off?
<FromGitter> <crisward> ok, using the same machine?
pawnbox has quit [Read error: Connection reset by peer]
<pudgy_x> logging is off yes, well he uses a i7 laptop , i use a core2duo Desktop 3 Ghz core
pawnbox has joined #crystal-lang
<pudgy_x> but the main http in crystal gets like 65000 REQ's on my machine, so
<FromGitter> <crisward> ssd?
<RX14> ssd shouldn't matter
<Papierkorb> Those CPUs are vastly different on its own already
<pudgy_x> ssd doesn't matter because the program is run from ram
<RX14> core2duo has lower singlecore perf probably
<pudgy_x> yes it does, but the main HTTP hello world from crystal gets 65K - 70K /s
<RX14> but it has no router
<FromGitter> <crisward> I think those benches are for comparison, have you done the sinatra one too?
<pudgy_x> crisward, you mean the sinatra clone , called frank?
<FromGitter> <crisward> No, ruby sinatra, as on his front page. I think he's trying to show it's x times faster
<pudgy_x> oww , no i haven't benched it, but indeed is a good indicator for comparison between my cpu and his
<pudgy_x> but not perfect, because i don't know which ruby version he used
<pudgy_x> and /if he compiled it from source etc
<foca> yeah, if you get consistently slower results between the diff benchamrks on the page, then it's probably just the cpu difference :)
<pudgy_x> i don't really think his laptop i7 is 300% more performant
soveran has quit [Remote host closed the connection]
<pudgy_x> even looking at his wrk results , his latency per request is close to mine
<RX14> you would be surprized
<FromGitter> <crisward> I think the point is, kemal is fast. From what I've messed with, I can't argue with that. Exactly how fast will obviously vary enormously between machines and applications.
<RX14> pudgy_x, what's your CPU model?
<pudgy_x> Q6600 OC'ed to 3 Ghz
<RX14> pudgy_x, I know this isn't overclocked but check the difference in singlecore
<RX14> it's over 2x
<RX14> sure, thats a desktop CPU but it's a few generations old
<pudgy_x> still with an OC, it's below 2x
<pudgy_x> and 22K vs 100K doesn't make sense
<RX14> different OS too though
<RX14> he's probably using macos
<Papierkorb> That OC won't fix everything
<pudgy_x> i use linux with a low latency kernel
<RX14> pudgy_x, 923/(2.4/3)
<Papierkorb> that can mess with other kind of software, e.g., servers
<pudgy_x> i wanted to ask him to test the default http hello world with wrk
<RX14> 1100 singlecore
<RX14> i estimate your OC will give
<RX14> not much more
<pudgy_x> hmmm
<pudgy_x> still curious what his results are with the default HTTP server
<pudgy_x> then that would also mean a very high performance combo mac + i7 mobile cpu
Philpax has quit [Ping timeout: 255 seconds]
<FromGitter> <crisward> hello world = 343540 requests in 10.10s, 39.64MB read - but I've got a tonne of stuff going on... For my 'real' bench a rebuilt a chunk of our node app. It went from 200ms response to 3ms. I think most of the 3ms is the mysql lookups.
Renich has joined #crystal-lang
<pudgy_x> wow
<Papierkorb> Just tried, Crystal 0.19.1, kemal git HEAD, apache bench (1M requests, 100+1k concurrent), give me 52k requests/sec for the hello_world sample
<pudgy_x> cris, you are using wrk?
<pudgy_x> ow 300K in 10seconds, i read 300k/s
<Papierkorb> huh 300k in 10 secs is 30k/s..
<FromGitter> <crisward> just used wrk without any settings, default to 10
<FromGitter> <crisward> but I'm running around 30 containers on this machine... so...
<pudgy_x> yeah that's something
<pudgy_x> not using unix sockets?
<pudgy_x> Papier, CPU you are using?
<Papierkorb> i5 6600K
<Papierkorb> No other "optimisations" besides building that thing in --release
<crystal-gh> [crystal] asterite pushed 4 new commits to master: https://git.io/viS37
<crystal-gh> crystal/master bdf8231 Ary Borenszweig: Compiler: don't include filename for Type#to_s for non-codegen code
<crystal-gh> crystal/master b1bca0b Ary Borenszweig: Fixed visibility modifier applied recursively inside class/module through macro
<crystal-gh> crystal/master 808f16f Ary Borenszweig: Use private types in a few places
<pudgy_x> mine is equal or above your performance
<pudgy_x> also compiled with the release flag
<pudgy_x> you use Linux i assume?
<Papierkorb> of course, ArchLinux x64 "latest"
<pudgy_x> nice
<pudgy_x> i use debian
<Papierkorb> Does the HTTP server support keep-alive connections?
<Papierkorb> Would boost the benchmark tremendously
<RX14> it does
<pudgy_x> have you disabled neagle's algo? Papier
<RX14> nagle*
<pudgy_x> yes nagle i mean
<Papierkorb> Nope, and for a quick benchmark, I don't want to mess with my systems configuration really
<pudgy_x> you can set it in crystal
<pudgy_x> server.tcp_nodelay = true
<RX14> what crystal version are you on pudgy_x?
<pudgy_x> 0.18.7
<RX14> does 0.19.2 change anything?
<pudgy_x> i haven't checked, but i am affraid things break right now if i try
<pudgy_x> :D
mark_66 has quit [Remote host closed the connection]
soveran has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
Renich has quit [Ping timeout: 248 seconds]
Renich has joined #crystal-lang
bjmllr has quit [Quit: WeeChat 1.0.1]
ssvb has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#7547cd8 (master - Compiler: fixed RangeLiteral#to_s. Fixes #3331): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/161351832
<DeBot> https://github.com/crystal-lang/crystal/issues/3331 (complex ranges break playground instrumentation)
<RX14> jhass, DeBot is replying to NOTICE messages
<RX14> that should never happen
bew78 has joined #crystal-lang
bjmllr has joined #crystal-lang
bjmllr has quit [Client Quit]
bjmllr has joined #crystal-lang
sandelius has joined #crystal-lang
sandelius has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
crystal-lang895 has joined #crystal-lang
crystal-lang895 has quit [Ping timeout: 240 seconds]
soveran has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<pudgy_x> sdog , are you there?
sandelius has joined #crystal-lang
bew78 has quit [Ping timeout: 265 seconds]
Raimondi has quit [Quit: WeeChat 1.6-dev]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
globalkeith has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
qard has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
soveran has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has quit [Remote host closed the connection]
kulelu88 has joined #crystal-lang
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<pudgy_x> last time, sdog?
<pudgy_x> before i leave :)
<pudgy_x> why have you forsaken me
<RX14> pudgy_x, sdogruyol comes on on gitter
<RX14> and you can't expect people to be on all the time
<pudgy_x> i'm just joking :)
<pudgy_x> but isn't gitter directly connected to this room?
<RX14> yes
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
globalkeith has joined #crystal-lang
globalkeith has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
greenbigfrog has joined #crystal-lang
<greenbigfrog> Hi
<havenwood> greenbigfrog: hi
<greenbigfrog> Can somebody tell me, why it's impossible to require by full path? f.e. /home/frog/project/src/project
<FromGitter> <raydf> what kind of benefit would you have with absolute paths?
<greenbigfrog> I'm trying to debug a lib ATM
<greenbigfrog> and I'm unable to require it from inside a project
<FromGitter> <raydf> why not using shards with file based
<FromGitter> <raydf> path: /perspectiva/apps/redis-pool
<greenbigfrog> is that a thing?
* greenbigfrog is a total crystal newbie
<FromGitter> <raydf> ok
<FromGitter> <raydf> shards is the dependency management system
<greenbigfrog> and then just require normally?
<FromGitter> <raydf> yes
<greenbigfrog> ok. thanks
<FromGitter> <raydf> np
<FromGitter> <greenbigfrog> can I comment with # in the shard.yaml?
<FromGitter> <raydf> yes Jonathan
<FromGitter> <raydf> is an standard yml file
* FromGitter * greenbigfrog is the same as greenbigfrog on IRC... (might be obvious)...
pudgy_x has left #crystal-lang [#crystal-lang]
<BlaXpirit> sigh, people leaving for gitter :(
<FromGitter> <raydf> :smile:
* greenbigfrog is in both
<greenbigfrog> I just have the browser on one screen, and my code etc. on the second monitor :)
<greenbigfrog> do I have to run "shards update" after changing the local file?
<FromGitter> <raydf> nop
<greenbigfrog> only after editing?
<greenbigfrog> *editing shards.yaml
<FromGitter> <raydf> only the first time
<greenbigfrog> ok
globalkeith has joined #crystal-lang
globalkeith has quit [Remote host closed the connection]
<FromGitter> <raydf> you could use guardian for autotest or autorun
<FromGitter> <raydf> https://github.com/f/guardian
<greenbigfrog> me?
<greenbigfrog> looks nice! I'll check it out :+1:
<RX14> I use entr, because it's simpler
<greenbigfrog> http://entrproject.org/ ?
<RX14> greenbigfrog, yes
<greenbigfrog> ok
<RX14> but its not really worth it for shards
<greenbigfrog> (haven't seen you in a while :) )
<RX14> wait
<RX14> oh yeah
Raimondi has joined #crystal-lang
<RX14> greenbigfrog, just symlink libs/yourproject to /path/to/yourproject/src
<RX14> then thats it
<greenbigfrog> ok
<greenbigfrog> is there sth like `rest-client` for crystal? (easy to use rest)
globalkeith has joined #crystal-lang
<greenbigfrog> oops... the HTTP::Client is also "simple"/basic enough... I should research first...
<FromGitter> <raydf> RX14, nice to know about entr, thanks for the tip.
<RX14> entr is nice for just a one-off
<RX14> but guardian looks much nicer for more serious stuff
<RX14> where you want presets
<FromGitter> <raydf> And when Crystal for windows get released :)
<RX14> i.e. never
<RX14> :)
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vi9Lz
<crystal-gh> crystal/master 91020b3 Ary Borenszweig: Fixed MacroLiteral#to_s regarding escapes. Fixes #3330
pawnbox has quit [Remote host closed the connection]
Ven_ has joined #crystal-lang
trapped has quit [Ping timeout: 240 seconds]
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
<FromGitter> <raydf> @asterite, when crystal is building, does the shards get recompiled each time or there's some kind of cache for the libs?
<RX14> @raydf, thats a complex question
<RX14> but
<RX14> the code is split into multiple "modules", which are units of code fed into LLVM
<RX14> the LLVM code gen part of the compiler stage takes the longest
<RX14> so the caching is done by caching the module code and the module output
<RX14> if the module comes out as the same code the precompiled object is taken
<RX14> i THINK
<FromGitter> <raydf> I'm deciding if separating a big project in shards for compiling performance gain?
<greenbigfrog> I actually should know this probably: If I have a float like "5.45e-06", how can I puts a string, which shows all 0? so that I get 0.00000545
<RX14> no
<RX14> not at all
<RX14> there's no way to do that because the interface is completely dynamic
<RX14> because of the global type inference, there's absolutely no seperation between shards and other required code
<FromGitter> <raydf> ok, thanks RX14
<RX14> the crystal compiler has no idea what's in a shard and whats required relative
<FromGitter> <raydf> I just wanted to check if there were some optimizations after the Type restriction and variables Types declaration changes at the beginning of the year.
<RX14> well
<RX14> it makes the part where you work out if the module (which are pretty much 1:1 with classes) is up to date or not quicker
<RX14> because the time spent in type inference is less
Ven_ has quit [Ping timeout: 265 seconds]
<greenbigfrog> did you see my question?
<FromGitter> <raydf> green.., maybe try "%.10f" % var
<FromGitter> <raydf> Thanks RX14
<travis-ci> crystal-lang/crystal#91020b3 (master - Fixed MacroLiteral#to_s regarding escapes. Fixes #3330): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/161440010
<DeBot> https://github.com/crystal-lang/crystal/issues/3330 (TypeNode#instance_vars returning empty array)
<greenbigfrog> thanks!
<greenbigfrog> (my issue actually was, that I was trying to use it on a string)
<FromGitter> <raydf> you should make sure to use a float
<greenbigfrog> yep
<FromGitter> <raydf> To everyone, the bug related to play.crystal-lang.org in firefox and chrome can only be temporarily solved by clearing the cache of the browser.
<RX14> which bug?
Ven_ has joined #crystal-lang
<asterite> raydf: each time you compile, everything gets analyzed from scratch. But then we can reuse some .o files from previous compilations if they didn't change (if the .bc file, which is LLVM bitcode, is the same as the previous compilation)
<asterite> Eventually we could do incremental compilation so that we don't need to analyze everything from scratch, though that's a huge and hard task
<FromGitter> <raydf> There's a .o file for each shard?
<asterite> there's a .o for each "unit". Right now a unit is a namespace, like a class or module
<FromGitter> <raydf> @asterite, There's a .o file for each shard?
<asterite> but I'm thinking maybe a unit should represent a single file
<FromGitter> <raydf> with open classes? I'm creating compiled views for a webapp and it's taking a good amount of time compiling around 30 views, each one is a different class inherited from an abstract class.
<RX14> asterite, wouldn't that be hard with reopening and stuff?
<RX14> i wouldn't have thought you could compile a file which can affect many different classes into one bc file
<asterite> yes, llvm only knows about functions, not classes, so every method in crystal gets compiled to a function and we choose where to put that
<asterite> raydf: how long does it take to compile?
<RX14> asterite, what about function overriding then
<RX14> and the class memory layouts have to be defined somewhere right?
<RX14> i thought llvm sorta handled that
<FromGitter> <raydf> it takes around 10 secs.
<FromGitter> <raydf> but in a web app that's a lot for fast iterations for each developer.
<asterite> RX14: Ah, yes... but maybe that could be defined in a separate file, but yeah, it needs more thought
<FromGitter> <raydf> just wanted to know if there's some way to make it faster
<asterite> raydf: yes, I know. Right now I don't think there's a way other than getting a faster machine (or I think if you are in mac it should be faster than in linux)
<asterite> but that's why we want to make sure the language can support incremental compilation in the future...
<RX14> asterite, i don't think files really make sense because the code of a function in one file can be affected wherever it's called in another because of how the compiler works
<FromGitter> <raydf> ok, thanks @asterite. We'll keep working as is, maybe later we should change the laptops :)
<RX14> @raydf how big is this webapp?
<FromGitter> <raydf> For the moment 30 views, some background workers and the toro router. I love the platform because the deployment is amazing with just one binary file :)
<greenbigfrog> thanks for everyones help! gotta get to bed rq
<RX14> @raydf, why is the warp binary in there?
<RX14> also
<RX14> it builds in 0.6 seconds for me
<asterite> I don't think more views should affect time, because the ECR program is compiled once and run for every view
<RX14> so i don't know what you're doing
<asterite> (assuming you are using ECR)
<FromGitter> <raydf> i'm using the warp:views
<asterite> what's warp:views?
<RX14> oh yeah
<FromGitter> <raydf> is a custom view template system
<FromGitter> <raydf> this is the framework
<FromGitter> <raydf> the views are commercial licensed
<FromGitter> <raydf> :)
<FromGitter> <raydf> after i finish the project i'll release the framework with tests and documentation
<FromGitter> <raydf> There's some examples: https://github.com/raydf/warp-example
<FromGitter> <raydf> It's like HTML components in crystal.
Ven_ has quit [Ping timeout: 265 seconds]
<FromGitter> <raydf> We're working in a validation framework, helpers components for fast developing and webpack with turbolinks, a crazy and opinionated framework :).
<RX14> ohh i don't think I could get used to those views
<FromGitter> <piedoom> That;s pretty interesting
Ven_ has joined #crystal-lang
<RX14> i find raw code to be a horrible templating system for html
<FromGitter> <raydf> yeah :) as i said is not for everyone, and designers hate them, but we are programmers/designers types :). Toro is a router also not for everyone :). But i love to have both options, Toro and Kemal :)
<RX14> yeah toro is interesting
<RX14> but not for everyone
<FromGitter> <piedoom> I have to agree that I'd prefer ECR but the idea itself is interesting
<FromGitter> <raydf> RX14, after the components are made and binded to the controller it's very easy to do.
<RX14> but i would rip out those views and replace them with something like slang
<FromGitter> <piedoom> I can't stand slang either personally
<FromGitter> <piedoom> That's like HAML, right?
<RX14> sorta
<RX14> i like haml
<FromGitter> <piedoom> Maybe I should check it out more
<FromGitter> <raydf> you create a datagrid component for example and is faster than creating a lot of ecr with partials.
<FromGitter> <piedoom> HAML is probably good for smaller things but it can get a little overcomplicated with bigger sites, or its at least super easy to do so
<FromGitter> <piedoom> IMO, of course.
<RX14> why does it get more complicated?
<Papierkorb> piedoom, HAML suffers from the same issues as does Python: Due to its "indentation is the body" it's only readable if the file is shorter than your monitor can display at once. Though for templates, that's a feature to me
<RX14> lack of reuse?
Ven_ has quit [Ping timeout: 265 seconds]
<FromGitter> <piedoom> It's not awful - it's just not very enjoyable to write
<RX14> I once wrote a 1400 line slim file and I liked it :P
<FromGitter> <piedoom> like ` =link_to 'Interested in Sponsoring?', image_path("BrickHack_Sponsorship_Information.pdf"), {class: 'button', style: 'margin-bottom: 60px;'}`
<FromGitter> <piedoom> I don't really understand how that's better than just writing HTML
<Papierkorb> piedoom, tbh I don't understand how people can stand writing plain HTML
<Papierkorb> it's awful
<FromGitter> <piedoom> fair point
<FromGitter> <piedoom> i think we can all agree that web dev frontend kind of sucks in at least one way :)
<RX14> because =foo is a lot shorter than <%= foo %>
<RX14> and no closing tags
<RX14> and the shorthand
<FromGitter> <piedoom> iirc there isn't a way to do a multiline link_to
<Papierkorb> HTML is meant to be parsed, not to easily read or written. Or if it was aimed towards that, it failed
<FromGitter> <piedoom> I think it's fairly easy to write
<FromGitter> <piedoom> not particularly enjoyable per say
<FromGitter> <piedoom> but I wouldn't call it difficult
<RX14> and the way you can embed any crystal code into the template is great too
<Papierkorb> piedoom, iirc you can use the pipe character | to split a statement into multiple lines
<RX14> yes
<Papierkorb> in HAML ^
<RX14> the front page here is a good example: http://slim-lang.com/
<FromGitter> <piedoom> I wish it was more similar to ERBs way of just `do` and then continuing on
<FromGitter> <piedoom> having a bunch of `|` would make the code look a little dirty
<Papierkorb> But if I need something like that, I take a step back and look what went wrong that I have to write such an ugly statement in a view template
<RX14> nodejs's version of slim is nice
<RX14> i forgot what it was called
<FromGitter> <piedoom> I haven't played with node yet
<RX14> but it solved the resuse problem quite a lot
<FromGitter> <piedoom> Is EMCA 6 nice?
<RX14> yeah, pretty nice
<Papierkorb> How do you define nice?
<RX14> typescript is nicer
<Papierkorb> It's much better than ES5, that's for sure
<Papierkorb> I mean much better
<RX14> both are still a tad ugly
<FromGitter> <piedoom> nice as in the opposite of es5
<FromGitter> <piedoom> yeah haha
<Papierkorb> But is it a really good programming language I'd wish to code much in? Nope.
<FromGitter> <raydf> let me show an example of Warp::View ``` <div> ⏎ <% if @name %> ⏎ Greeting, <%= @name %>! ⏎ <% else %> ⏎ Greeting! ... [https://gitter.im/crystal-lang/crystal?at=57e1ac05c8af41d45f3105e5]
<FromGitter> <piedoom> I just wish that we could stop the fad of writing desktop apps in JS/HTML
<RX14> they're not great languages, and the callbacks and promises of nodejs are quite unweildy compared to CSP/crystal
soveran has quit [Remote host closed the connection]
<RX14> yield is nice though
<RX14> using yield + promises is quite nice
<RX14> because you get the composability of promises and cleanish code
<Papierkorb> piedoom, I agree. I'm wondering what went wrong when people say how awesome JS is and that people who dislike it are stupid? "Hurr it's the most used language for a reason!" Yes, the reason being "you have no other choice than to use it". Great reasoning Mr. JS Guy
Oliphaunte has quit [Remote host closed the connection]
<RX14> yeah, JS isn't the nicest langauge by any measure
<FromGitter> <piedoom> I mean, I gotta admit after doing more JS I don't hate it as much as I used to, but it's still riddled with problems and is definitely used where it probably shouldn't be
<RX14> but it's a whole lot better and more usable
<RX14> and the libraries are really quite nice
<FromGitter> <piedoom> honestly JS by itself isn't too bad for desktop apps, its the HTML part that makes them near unusable
<FromGitter> <piedoom> e.g. this terrible gitter app
globalkeith has quit [Quit: Textual IRC Client: www.textualapp.com]
<RX14> i like react honestly
<Papierkorb> I find many of their libs to be too hard to use. Just try building a Hello World app in EmberJS.
<FromGitter> <piedoom> I just started learning react and I quite like it
<RX14> especially redux
<Papierkorb> Compile this, copy that, use a friggin development server ... What about just no?
Renich has quit [Quit: leaving]
<RX14> yeah the tooling is a pain
<FromGitter> <piedoom> React native is actually a very cool project
<RX14> but then I get to use webstorm with TS
<RX14> sooo
<FromGitter> <piedoom> lol
<FromGitter> <piedoom> speaking of, has anyone made some sort of GUI interface thing for use with crystal?
<Papierkorb> For desktop applications? There's a GObject (-> GTK) proxy around but never tried
daekano has quit [Ping timeout: 272 seconds]
<Papierkorb> Then there's CrSFML by BlaXpirit if you want to build a game or something
<FromGitter> <piedoom> I saw CrSFML, looks pretty neat for game stuff.
<FromGitter> <piedoom> Haven't seen libui though yet
<FromGitter> <piedoom> Seems very cool
<FromGitter> <piedoom> I love how Crystal basically took everything I wanted from Ruby and made it into a language
<FromGitter> <raydf> RX14, in slang how you compose a webapp?
<FromGitter> <raydf> in the context?
bjz has quit [Read error: Connection reset by peer]
Oliphaunte has joined #crystal-lang
bjz has joined #crystal-lang
<FromGitter> <raydf> or with yield?
<RX14> @piedoom libui would be the best bet i think
<RX14> @raydf in traditional alim, you would use yield
<FromGitter> <raydf> I can't find an example or test for that
<RX14> well
<RX14> yeah slang itself is a bit immature
<RX14> but slim uses it everywhere
Oliphaunte has quit [Remote host closed the connection]
<FromGitter> <raydf> ok, i saw the slim website with the yield part. Maybe in the future we could reevaluate it.
<FromGitter> <raydf> thanks.
<RX14> @raydf yeah i think slim needs a bit of a rethink and rewrite
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
ssvb has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
<FromGitter> <raydf> @asterite, i read the code for ECR and it's a great way to build fast views. Thanks for your help. I still prefer crystal code for views, including modules for compositioning and the type safety of the compiler, so i'll continue waiting for the 5-10 secs of compiling time :).
<RX14> @raydf
<RX14> i don't think ECR would be faster
<RX14> ECR just generates crystal code
<RX14> so it has the translation AND complication time
<FromGitter> <raydf> ooops, right, the run/process just create more crystal code io << "Hello"
qard has joined #crystal-lang
<FromGitter> <raydf> I'm starting to believe is related to all the shards i have as dependencies. It takes 4 seconds for semantic main and 3 seconds for Codegen crystal
<FromGitter> <raydf> thanks RX14, asterite, and everyone else.
Oliphaunte has joined #crystal-lang
Crizkov has joined #crystal-lang
<Crizkov> greyblake: crystal-icr works out-the-box in ArchLinux, it's amazing, Thanks for create it! :-)
Crizkov has quit [Client Quit]
Oliphaun_ has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
bew78 has joined #crystal-lang
Oliphaun_ has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
bew78 has quit [Ping timeout: 240 seconds]
bew78 has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]