RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.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> <girng> i replied to KitchenAstronomer in will crystal survive thread
<FromGitter> <j8r> Because its quite true
<FromGitter> <j8r> They may have projects not very developed after finished. They will stick to a version of the compiler that must be stable with no bugs (not too many)
<FromGitter> <j8r> There are lot of companies like that, sadly
<FromGitter> <j8r> But for tech companies using the latest nightly techs are usually not a problem, like us :)
<FromGitter> <girng> i see, thx
zorp has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
<FromGitter> <girng> vscode is really nice. not having any code deletion on save issues, thank goodness :D
<FromGitter> <girng> never using sublime again :D
<FromGitter> <asterite> I'm using sublime since the beginning of Crystal, never had a problem with it. Maybe it's not working well on windows, though...
<FromGitter> <girng> @asterite yeah, i never had an issue with it until the recent sublime crystal package update. (the one that fixed the cmd popup on save). it would sometimes randomly cut my entire code in half on save. i should have posted a github issue about it on the crystal sublime page, but i can never reproduce it (just happens out of pure randomness during the day)
<FromGitter> <girng> i almost lost my master gameserver file and so i raged a couple days ago, made more backups and then moved to vscode. but yeah prob window thing
<FromGitter> <fridgerator> Are you using version control (Git) ?
<FromGitter> <girng> not me, git is too confusing
<FromGitter> <Qwerp-Derp> Git isn't that confusing with VSCode, it handles commits and stuff for you already and all you have to do is `git push origin master`
<FromGitter> <girng> o yea, i thought he meant through cmd line only
<FromGitter> <girng> plus, i don't have anything valuable for github anyway lol
<FromGitter> <bew> Git and github are 2 different things
<FromGitter> <bew> You can you git without using github
<FromGitter> <bew> You can *use
<FromGitter> <Qwerp-Derp> @girng Fair enough, I personally put all of my projects on GitHub regardless
return0xe has quit [Ping timeout: 244 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <fridgerator> @girng But you just said you almost lost a whole file.
<FromGitter> <fridgerator> With git, even used locally, this can be avoided.
<FromGitter> <girng> @Qwerp-Derp if i read crystal's github or any issue, i have literally zero idea of what is being discussed. it's like a totally different language. i just stick to gitter.im because knowledgeable and nice people
<FromGitter> <fridgerator> But the two are not related
return0e has joined #crystal-lang
<FromGitter> <girng> @fridgerator my bad. i thought u meant something else
<FromGitter> <girng> @fridgerator if i setup git it saves file on save?
<FromGitter> <girng> i don't want to go back to sublime ima just use vscode for now it's fine havn't had any issues so far (windows)
<FromGitter> <girng> i should made an issue in their repo though, other people could experience it
<FromGitter> <fridgerator> issues are just a feature of github
<FromGitter> <fridgerator> No, git does not "save" on file save
<FromGitter> <fridgerator> only when you make a commit
<FromGitter> <bew> @girng checkout https://www.makeuseof.com/tag/git-version-control-youre-developer/ it has a simpke explanation of what git does, and how version control works
<FromGitter> <fridgerator> you can go back and see every version ever of every file
<FromGitter> <fridgerator> it might be confusing at first, but using basic git is not difficult
<FromGitter> <fridgerator> I would never EVER not use git on any project, its mandatory
<FromGitter> <Qwerp-Derp> @girng Same here TBH, but that's because most of what's discussed in the issues is about compiler internals (same for you as well) - I sort of understand what the issue is about if it's more abstracted than just the raw compiler
<FromGitter> <girng> too advanced for me. i just do crystal build MasterServer.cr --static and my gameserver is ready. but if i ever push to github or contribute stuff (if i become smarter in the future) i will prob use it. thx for links i bookmarked
<FromGitter> <bew> You don't need to have a github project, or to have many people contributing to use git
<FromGitter> <fridgerator> what if you delete a file? or you computer crashes?
<FromGitter> <bew> Git is amazing when you're working alone, offline
<FromGitter> <girng> well, after this sublime text fiasco i got tons of backups 😂
<FromGitter> <bew> But git IS your backup system (on steroid)!
<FromGitter> <girng> lol iuno man i just don't feel like i need
<FromGitter> <bew> I can assure you that you do ^^
<FromGitter> <fridgerator> Its game changing (no pun intended)
<FromGitter> <girng> LOL nice one
<FromGitter> <bew> Ahah 👍
<FromGitter> <girng> @Qwerp-Derp yeah, a lot of the stuff goes straight over my head. but i kinda like it cause it reminds me people are still doing great things with crystal
<FromGitter> <girng> i also don't understand all this qqing about compile times on reddit. doesn't make any sense to me
<FromGitter> <girng> how big does your project need to be in order for compile times to actually be detrimental towards development???
DTZUZO has quit [Ping timeout: 252 seconds]
<FromGitter> <bararchy> I can promise that even quite large projects don't suffer from compile time issues
<FromGitter> <bararchy> for our product `find . -name '*' | xargs wc -l` reports: `236281 total`
<FromGitter> <bararchy> you can take 1000 off by being config files\docker , etc..
<FromGitter> <bararchy> wait... this number seems too big
Groogy has quit [Read error: Connection reset by peer]
<FromGitter> <bararchy> let me test again
<FromGitter> <bew> try `cloc .`
<FromGitter> <bararchy> ok, makes more sense: `68388`
<FromGitter> <bararchy> it takes `26.07s` to compile on `Intel Xeon E3-1505M v6 (8) @ 4.000GHz`
<FromGitter> <bararchy> using the `--release` and `--no-debug` flags
<FromGitter> <bew> and without release flag?
<FromGitter> <bararchy> 1) 48s
<FromGitter> <bararchy> btw, a much smaller RUST project (7709 lines) take `cargo build --release 45.29s user 1.51s system 197% cpu 23.728 total` to build on release (and uses much more CPU power)
<FromGitter> <bew> i might be tempted to say that crystal has fast compilation times :p
<FromGitter> <bararchy> lol so it seems
<FromGitter> <bararchy> someone should make a compilation time benchmark for multiple languges
<FromGitter> <drujensen> there was an article from a RoR’s dev comparing it to Amber. Amber’s compile times are pretty slow and we will be working to fix that soon. It was comparing apples to oranges
<FromGitter> <drujensen> let me see if I can dig it up
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
ashirase has quit [Ping timeout: 264 seconds]
ashirase has joined #crystal-lang
alex`` has joined #crystal-lang
DTZUZO has joined #crystal-lang
_whitelogger has joined #crystal-lang
zorp has joined #crystal-lang
<FromGitter> <j8r> Git or any VCS. I agree git is a bit complicated (and cli not really consistent). I'm looking forward for alternatives like Pijul
<FromGitter> <DanielSokil> What do you like about Pijul?
<f1refly> girng: Compile times become important when you plan on going seriosly big. The product of the company i work for takes about an hour to compile and it's written in c++. Now imagine it'd take 3 times as long...
<FromGitter> <j8r> There is also Fossil, that SQLite project use
<FromGitter> <j8r> I don't know much about Pijul, but I hope the successor of Git will be easier
<FromGitter> <j8r> how can I do in crystal `setcap cap_net_bind_service=+ep ./mybinary`?
<FromGitter> <j8r> I will need to bind to `/usr/include/linux/capability.h`
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <valamorgon> when I use ⏎ crystal eval 'p Dir.entries(".")' ⏎ entries returns me this array: ⏎ [".", "tonga", "..", "tenka", "w", "tanakasan", "cornelia", "manmans"] ⏎ why tonga is before parent folder? it is actually a problem for me [https://gitter.im/crystal-lang/crystal?at=5b82b77b9c71d363c130938f]
<FromGitter> <valamorgon> $ ls -ltr ⏎ total 24 ⏎ drwxr-xr-x 2 root root 4096 Ağu 26 15:30 tenka ⏎ drwxr-xr-x 2 root root 4096 Ağu 26 15:31 cornelia ⏎ drwxr-xr-x 2 root root 4096 Ağu 26 15:33 w ... [https://gitter.im/crystal-lang/crystal?at=5b82b7c758a3797aa3bbf94f]
<FromGitter> <valamorgon> I guess I will just use $ crystal eval 'p Dir.entries(".").sort' but still wonder we have this order according to what
<FromGitter> <asterite> Please report a bug
<FromGitter> <lwakefield> Hey - I'm trying to write a "properties" macro for a struct that turns instance properties into a named tuple: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5b82bd9efd3c641b0610e62e]
<FromGitter> <lwakefield> Is there an obvious mistake I am making?
<FromGitter> <j8r> Why not using a Struct in the first place?
<FromGitter> <lwakefield> ah - lovely! thank you!
<FromGitter> <j8r> e.g. https://crystal-lang.org/api/master/toplevel.html#record(name,*properties)-macro
<FromGitter> <lwakefield> I skimmed through that section, but clearly didn't grok it.
ua has quit [Ping timeout: 252 seconds]
<FromGitter> <j8r> the `case` example is no longer a good one
<FromGitter> <lwakefield> @j8r I am using a struct, but I wanted something that I could iterate over..
<FromGitter> <lwakefield> granted - I am just experimenting, so it may end up being the wrong approach.
<oprypin> j8r, yes it is still a good example
ua has joined #crystal-lang
<FromGitter> <j8r> maybe not in 0.26.0
<FromGitter> <j8r> no it is i the release
<oprypin> you dont get it
<oprypin> maybe you should read that section as well, and try it if you don't believe
<FromGitter> <j8r> I don' really get the purpose of the PR so
<FromGitter> <j8r> Hum yes I get, this is when we are already in a macro, that produces a case when
<FromGitter> <j8r> @lwakefield if you want to iterate in the NamedTuple, and then having a big `case` when, you could use a Struct and have conditions generated by macros instead
<FromGitter> <lwakefield> aye @lwakefield - that is exactly what I am doing! Now facing other (programmer) issues.
<FromGitter> <j8r> It may be not understandable, but you get the idea
<FromGitter> <j8r> the advantage is type safety, and also performance
_whitelogger has joined #crystal-lang
<RX14> lol the compiler formatter spec passes on windows
<RX14> so i guess thats actually pretty useful already lol
<RX14> no need to WSL just to run the formatter on your code
<FromGitter> <girng> @bararchy that's my point
<FromGitter> <girng> it was rhetorical question
<FromGitter> <girng> @F1ks3r but what percent of people's projects that take 1 HOUR to compile are using crystal?
<FromGitter> <girng> the only time i heard of long compile times are triple a games, for example path of exile's server code in C++ takes staggering long to compile. but why would they ever move to crystal? wouldn't make much sense. so how does reddit users use this an argument that "long compile times" are an issue? doesn't make sense to me, are they saying crystal needs to conforms to very large businesses that have 1hour+compile
<FromGitter> ... times on their c++ project, so they can benefit from crystal? :wacko:
<FromGitter> <j8r> Speaking of c++, which has notoriously slow compile times, how is comparing Crystal compile times?
return0e has quit [Remote host closed the connection]
<FromGitter> <drosehn> to @valamorgon : I suspect crystal is reporting the entries as returned from the system-routine `readdir()`. If you have `irb` installed, it would be interesting to know what you get from `Dir.entries(".")` in ruby.
<FromGitter> <drosehn> Most of the applications I have written do not care what order the entries in, and when processing a large directory there would be some no advantage in adding the overhead of sorting the entries. It's also true that some filesystems available on Unix, there is no entry for `.` or `..`, although most people don't need to work with those filesystems.
hightower2 has joined #crystal-lang
<RX14> yeah it's not a bug
<RX14> ls always sorts it's output
<RX14> you can turn it off with a argument to ls
<RX14> and then you'll get the same order
<RX14> yeah
<RX14> ls -U
<FromGitter> <j8r> it sort by ctime by default
<RX14> no, it sorts alphabetically by default
<RX14> you need -t for ctime sorting
<FromGitter> <j8r> ok!
<FromGitter> <j8r> hum that was was an alias my bad
<FromGitter> <vladfaust> Can I somehow restrict types to a module while doing `forall T`? E.g. `forall T of MyModule`
<FromGitter> <straight-shoota> @vladfaust no
<FromGitter> <Sija> @vladfaust you can just restrict argument type
<FromGitter> <Sija> `def foo(klass : MyModule)`
<FromGitter> <Sija> or `def foo(klass : MyModule.class)` depending whether you expect an instance or class type
sevensidedmarble has joined #crystal-lang
<sevensidedmarble> hows everyone doing today?
<FromGitter> <drosehn> overtired? 😄
<FromGitter> <girng> @Sevensidedmarble good. hbu?
<FromGitter> <Sija> quite allright, commiting some code, making elderberry jam, being tired of kids… ;)
<FromGitter> <girng> i love jam
<FromGitter> <girng> on toast, with butter and peanut butter. YUMM
<FromGitter> <Sija> mmm, peanut butter with jam is damn tasty :>
<FromGitter> <Sija> even better is tahini with it
<FromGitter> <girng> yep fills me up too. if i get 2 large pieces for breakfast :O
<FromGitter> <girng> what's that one sec googling
<FromGitter> <Sija> my simple and delicious recipe for sth delicious is banana + tahini + some (preferably) sour jam/marmolade
<FromGitter> <girng> oh i think atmy indian's friend house couple years ago he put that on tortilla's was super good
<FromGitter> <Sija> optionally bit of ginger, cinammon and/or cardamom
<FromGitter> <girng> i was helping his cousin with his restaurent website, and they made me dinner :O
<FromGitter> <valamorgon> @Sija I'm hungry, do you accept any guests?
<FromGitter> <Sija> uhm, indians use it a lot
<FromGitter> <Sija> haha, sure, come on over! :D
<FromGitter> <valamorgon> @Sija cool, drinks are on me
<FromGitter> <girng> indian's are super nice people. my entire childhood i was friends with all of them
<FromGitter> <valamorgon> lol
<FromGitter> <girng> they taught me some cuss words too lol
<FromGitter> <girng> their families are very nice, always giving
<FromGitter> <Sija> @valamorgon u got it :P
<FromGitter> <j8r> Sure, but living in India, specially as a female, is another story :/
<FromGitter> <j8r> anyway I love their foods
<FromGitter> <Sija> @gring true, they have such a rich culture, even tho’ very different from the west one
<FromGitter> <Sija> tahini btw is super healthy too, and sooo good - with honey it tastes kind of like halva
<FromGitter> <girng> @j8r good point. actually my friend moved out of his parents house cause they wanted an arranged marriage
<FromGitter> <girng> he joined the military too. i havn't seen him in ages, kinda miss him :(
<jokke> i forgot the name of the shard that allows embedding static files into the binary
<FromGitter> <Sija> sth like `baked_fs`?
<jokke> ah!
<jokke> thanks
<jokke> that was it
<jokke> thank you :)
<FromGitter> <Sija> yw :)
<FromGitter> <girng> what's difference between baked file system and calling include of file.read?
<FromGitter> <girng> include OR file.read
<FromGitter> <Sija> @gring baked fs “embeds” the assets inside the binary in contrary to reading them during runtime
<FromGitter> <girng> for example, i do `Items = JSON.parse(File.read "./src/Data/Items.js")` and what if Items.js becomes like 10mb in size? If i bake it and then link it, compile times are faster?
<jokke> girng: great for self contained webapps
<FromGitter> <Sija> in this way you don’t need to include any additional files alongside your binary
<FromGitter> <girng> isn
<jokke> you just dump everything in one binary and be done with it
<FromGitter> <girng> isn't that what --static does?
<jokke> no
<jokke> that's static linking
<jokke> of c libraries
<FromGitter> <girng> o
<FromGitter> <girng> ohh i get it.
<FromGitter> <girng> so for example, i can bake my items.js into the binary instead of including it where my app executable is at
<jokke> i use baked fs for this scenario: i write a crystal api and then some frontend code which i bundle with webpack. crystal will then add all the bundled frontend assets into the binary so i can serve them directly from my crystal web app
<FromGitter> <girng> if i got that right?
<jokke> yeah
<jokke> exactly
<FromGitter> <girng> omg epic
<FromGitter> <girng> starred
<jokke> yeah :)
<FromGitter> <Sija> downside is that you need to compile new version of your app every time you’d need to update (any of the) included assets
<jokke> true
<FromGitter> <girng> ty for explanation. rofl i just thought --static was the same as bake. good thing i asked a question 😂
<FromGitter> <vladfaust> Thanks, @Sija
<FromGitter> <Sija> @vladfaust yw
<FromGitter> <j8r> that's how its done for `crystal doc`, I suppose?
<FromGitter> <Sija> nope, none of that
<FromGitter> <Sija> `crystal doc` generates docs package in a folder with html, css and js, no need for neither bundling anything (if u mean using `baked_filesystem`), nor static linking - since it’s not an app
<FromGitter> <Sija> it copies that to the dist folder
<FromGitter> <Sija> I mean css and js, html files are used as `ECR` templates from which final html files are generated
<FromGitter> <j8r> for me that's normal html
<jokke> hmm how can i catch 400 requests in HTTP::Server?
<jokke> *404
<FromGitter> <Sija> @j8r yep, but playground is served dynamically
<jokke> i'm using Prism::Router but it always calls next so i can't really add somekind of fallback handler after it
<FromGitter> <Sija> usually 404’s are being `raise`d from inside of the router
<jokke> mmh not here
<jokke> hm if i could find out if content has been written to the response
<jokke> nah not possible
return0e has joined #crystal-lang
<FromGitter> <j8r> thx @Sija !
<jokke> vladfaust: any ideas?
<jokke> vladfaust: i need a fallback to an index.html since i'm doing javascript routing
<jokke> vladfaust: does prism write something to the context which i could check to see if a route has been matched?
<FromGitter> <j8r> raising for 404s doesn't seem very efficient...
<jokke> yeah
<jokke> had to do it like this: https://p.jokke.space/QM17/
<jokke> soo i can check if action is set?
<FromGitter> <vladfaust> There are literally the lines
<FromGitter> <vladfaust> Yes, you can
<jokke> yup, works great!
<jokke> thanks
<jokke> any reason you chose to always call next in Action?
<FromGitter> <vladfaust> Sorry, I don't understand what `call next` you're talking about
DTZUZO has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.2]
hightower2 has quit [Ping timeout: 252 seconds]
sevensidedmarble has quit [Ping timeout: 276 seconds]
DTZUZO has quit [Ping timeout: 244 seconds]
sagax has joined #crystal-lang
DTZUZO has joined #crystal-lang