snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter>
<bew> ysbaddadden is doing another crystal :p
That_Guy_Anon1 has joined #crystal-lang
<FromGitter>
<girng> ok so i have another question are u ready
<FromGitter>
<bew> don't ask to ask, just ask ^^
<FromGitter>
<girng> i was looking over the api, and saw this: https://crystal-lang.org/api/0.24.2/WeakRef.html what is it used for, when crystal has a GC already? don't the objects already become ready to be garbage collected if they are not referenced anymore?
That_Guy_Anon has quit [Ping timeout: 240 seconds]
<FromGitter>
<bew> yes they are, but here the usage is to be able to reference the object but allow it to be GC'ed. I think a usecase would be a cache or sth like that
That_Guy_Anon has joined #crystal-lang
<FromGitter>
<girng> yeah
<FromGitter>
<girng> i'm done with memory
<FromGitter>
<girng> too confusing, I AM SO DONE
That_Guy_Anon1 has quit [Ping timeout: 265 seconds]
<FromGitter>
<LWFlouisa> So in this case, all I had to do was instruct crystal to do a system call to have the terminal do a one line local host command. So now I can build it within crystal without having to having a ruby program dependancy.
<FromGitter>
<bew> wut ^^ what are you trying to do?
<FromGitter>
<LWFlouisa> Have a self-hosted webpage.
<FromGitter>
<LWFlouisa> In other cases, using hashes.
<FromGitter>
<bew> ok, what can't you do in Crystal
<FromGitter>
<LWFlouisa> Well what I cant do is different from what others cant. I cant seem to figure out how to do something equivalent to Ruby's: code.map do |w|
<FromGitter>
<LWFlouisa> So I'm having to fallback to using .tr
<FromGitter>
<LWFlouisa> Really looking forward to trying this Crystal Qr Code thing.
<FromGitter>
<bew> can you show some code? because `Hash#map` does exist
<FromGitter>
<LWFlouisa> Ah with the number? And sure, where do you want it sent?
snsei has quit [Remote host closed the connection]
<FromGitter>
<bararchy> 282 users, that sounds a little low no?
That_Guy_Anon has joined #crystal-lang
<FromGitter>
<mamantoha> Maybe you're right. I can't find myself :)
<FromGitter>
<bararchy> do you have a crystal repo? maybe it's not counting forked repos
That_Guy_Anon has quit [Ping timeout: 264 seconds]
<FromGitter>
<straight-shoota> Might be reasonable
<FromGitter>
<straight-shoota> I mean there are certainly many more people using crystal, but a lot of them probably hasn't published any shard on github
<FromGitter>
<straight-shoota> There are 3k repos, and while 10 repos/user on average seems too high, there are also organisations
<FromGitter>
<straight-shoota> Would be a fun excercise to dig through GitHub's API to see if there are any discrepancies...
<FromGitter>
<bararchy> language:javascript location:russia matches users in Russia with a majority of their repositories written in JavaScript.
<FromGitter>
<bararchy> `majority`
<FromGitter>
<bararchy> so this only shows users with majority or repos in Crystal
<FromGitter>
<bararchy> So per their docs `language:crystal` is only users which have majority of repos written in Crystal
<FromGitter>
<bararchy> maybe we can somehow filter "at least oine"
pbodev1 has joined #crystal-lang
duane has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
<FromGitter>
<mamantoha> Someone can try get all Crystal repositories and get owners
<livcd>
I want to get a statistic of programming languages used by location @ github :S
<livcd>
ah i can just type location:
shalmezad has joined #crystal-lang
<FromGitter>
<bararchy> livecd any interesting facts you found?
<FromGitter>
<bararchy> where do people mostly use Crystal ?
fr3d has joined #crystal-lang
<fr3d>
Hi
<FromGitter>
<bararchy> hi
<livcd>
nothing much
<livcd>
I have triggered the abuse detector mechanism :S
<FromGitter>
<bararchy> so it's mem usage of the compiler while compiling
<FromGitter>
<sdogruyol> yup
<FromGitter>
<sdogruyol> I thought it's pretty obvious, isn't it?
<FromGitter>
<bararchy> Wasn't sure tbh, I thought it might be the binery size in mem? or maybe some file collection etc..
<FromGitter>
<bararchy> yeha, I guess now i should have guessed
<FromGitter>
<bararchy> I also remmber that people said programs take lots of mem to get compiled, but 219 isn't that high
<FromGitter>
<sdogruyol> well, if you don't have a lot of macro / templates..it should be OK
<FromGitter>
<bararchy> we also use 11 other shards in it
<FromGitter>
<bararchy> 1) std lib that gets added while compiling
<FromGitter>
<bararchy> so overall it's lots of lines of code
<FromGitter>
<bararchy> our bin is at 1.5Mb size
<FromGitter>
<bararchy> it's cool :)
<FromGitter>
<sdogruyol> awesome :metal:
<FromGitter>
<bararchy> so, our solution is right now 31599 lines of code alone
<crystal-gh>
[crystal] sdogruyol pushed 2 new commits to master: https://git.io/vxxKo
<crystal-gh>
crystal/master 89cb674 Johannes Müller: Add examples for parse(IO) to JSON, YAML...
<crystal-gh>
crystal/master 4400657 Serdar Dogruyol: Merge pull request #5936 from straight-shoota/jm/docs/json-yaml-read-file...
<FromGitter>
<sdogruyol> without any dependencies?
<FromGitter>
<bararchy> yeha
<FromGitter>
<sdogruyol> that might be the biggest Crystal codebase, after the Crystal compiler
<FromGitter>
<sdogruyol> how long does it actually take to compile?
<FromGitter>
<bararchy> on release ?
<FromGitter>
<sdogruyol> both
<FromGitter>
<bararchy> CPU: Intel Xeon CPU E3-1505M v6 @ 4GHz ⏎ ⏎ `--release` > make 25.58s user 0.87s system 44% cpu 59.552 total ⏎ `--debug` > make debug 11.73s user 1.20s system 64% cpu 20.119 total [https://gitter.im/crystal-lang/crystal?at=5acf637c109bb04332b5e194]
<FromGitter>
<bararchy> @sdogruyol
<FromGitter>
<sdogruyol> wow, you got some horsepower there haha
<FromGitter>
<bararchy> :)
<FromGitter>
<bararchy> ls
<FromGitter>
<yxhuvud> 25s is a lot though.
<FromGitter>
<bararchy> I think total is the actual time no?
hightower3 has joined #crystal-lang
<FromGitter>
<bararchy> I wish the compiler could use multiple cores to compile, that would make it even faster
hightower2 has quit [Ping timeout: 264 seconds]
<FromGitter>
<j8r> and reusable precompiled objects
duane has quit [Ping timeout: 260 seconds]
<FromGitter>
<bararchy> It uses those , but only in non release mode
SuperChickeNES has quit [Quit: ZNC 1.6.1 - http://znc.in]
<FromGitter>
<sam0x17> @yxhuvud no, nor should crystal be needed to run a crystal-produced binary in production -- you just compile the binary with --release --static and you can run it on virtually any linux server
<FromGitter>
<yxhuvud> ah right, you don't compile in place. good point. It may be hard to get the arch specific optimizaitons unless you know what to specify then though.
<crystal-gh>
[crystal] sdogruyol closed pull request #5606: Markdown: fix handling of code fences appearing on the same line (master...code-fence) https://git.io/vN0oC
<FromGitter>
<wrq> I'm having difficulty installing crystal on armhf. On Xenial, but dist.crystal-lang.org/apt crystal InRelease doesnt support the armhf arch
<FromGitter>
<wrq> I think I had crystal installed on this machine before, dont really remember
<FromGitter>
<j8r> yes, with the portalier repo
<FromGitter>
<j8r> bu it's quite old now (0.23.1)
<FromGitter>
<wrq> so if I want to run 0.24-*, what do I do?
<FromGitter>
<wrq> can I use that old version's binary to build 0.24 from source?
<FromGitter>
<j8r> you need to cross-compile it :-/
<FromGitter>
<j8r> hum yes
<FromGitter>
<j8r> you can compile the new compiler with the old one
<FromGitter>
<j8r> But on the system side, for the CI and Docker, I can help. I'm working on an Alpine container that have all we need to make static crystal binaries :-D
<FromGitter>
<wrq> hey just FYI, that portalier person's site is updated, that repo has a crystal 0.24.2 that builds on armhf
<FromGitter>
<wrq> which saves me some work, which is awesome
<FromGitter>
<j8r> great!!
<FromGitter>
<wrq> yes, thank you btw, I appreciate your help! I did some googling before I asked the chat, but I'm glad you were around to help!
<FromGitter>
<j8r> np! not easy to find, I have this link still lying on my history :-)
<FromGitter>
<sam0x17> @yxhuvud the alternative is to have a dedicated cloud function that does your build and deploys another cloud function based on args
<FromGitter>
<sam0x17> I'm planning on releasing something that automates this
<FromGitter>
<girng> btw @oprypin you make me feel very sad in the past couple days. please be more nicer to me, i praise your education and look up to smarter people than me, thank you
<crystal-gh>
[crystal] RX14 closed pull request #5839: Update CI distribution scripts (master...feature/gc-large-config) https://git.io/vx38P
<FromGitter>
<fridgerator> @girng he's very terse and rude, dont take it personally
flaviodesousa has quit [Ping timeout: 276 seconds]
<FromGitter>
<girng> @fridgerator it's fine really. i understand im annoying sometimes asking a lot of redundant questions and not listening 100%. i just ask to be more tolerant towards me that's all. i like opyrpin and he has helped me a lot.
<FromGitter>
<girng> i learned a lot already and appreciate it from all too.
<FromGitter>
<veelenga> > btw, this is really cool https://github.com/veelenga/ameba ⏎ @bararchy it is usable, but still requires a lot of work. I need to prepare some roadmap. Maybe someone who interested would join and help
<FromGitter>
<bararchy> @veelenga I'll take a look at the code and try to help out, I opened relevant issues I found
<FromGitter>
<bararchy> @girng you're fine :) we love you here keep the questions coming
<FromGitter>
<veelenga> @bararchy i've seen. Thx
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<bararchy> @veelenga it's a really good tool, I integrated it with circleCI and our release cycle it really helps my manage code style from new devs
qard has joined #crystal-lang
<FromGitter>
<veelenga> @bararchy wow, great! I hope it will do much more in the future. So much can be done here...
<RX14>
@bararchy compiling without --debug should be faster
<RX14>
and --debug is useless unless you go in with gdb
<RX14>
--debug != no flag
<FromGitter>
<bararchy> I know, we use lldb for some stuff
<RX14>
hmm
<FromGitter>
<bararchy> I prefer puts debugging , my some prefer lldb
<RX14>
I wonder what the difference is though
<RX14>
between --debug and no flag
<RX14>
would be useful to get times
<FromGitter>
<bararchy> I'll create a list in a gist of all options :)
<FromGitter>
<bararchy> I also remove the cache dir between each compile (when benchmarking not usually)
<RX14>
--lto=thon likely won't get you anything except for in release mode builds
<FromGitter>
<bararchy> I'll also add thin lto
<RX14>
@bararchy nah you need a full matrix of
<RX14>
cache, no cache
<RX14>
lto
<RX14>
debug options
<RX14>
release options
<FromGitter>
<bararchy> Sure, if it interest people I'll take the time to make it
<RX14>
it'd be interesting, not sure how useful
<RX14>
if you have free time it'd be fun
<RX14>
and doing the same with the compiler would be interesting to see how the codebase affects it
<RX14>
since the compiler and spec suites are really the only large codebases we have to compare
<FromGitter>
<bararchy> We don't have many macros etc.. As we always know the ENV and external details before compiling , I guess this saves us from much longer compile times, also we don't have any `T` usages
<RX14>
any large class hierarchies?
<RX14>
or is it just pure maths for the large part
wrqrb has quit [Quit: Connection closed for inactivity]
<FromGitter>
<bararchy> RX15
<FromGitter>
<bararchy> LOL damn
<FromGitter>
<bararchy> RX14 we have 12 shards , some are ours and some community , we got around 30-35k lines of code in main project .
<RX14>
cool
duane has joined #crystal-lang
<FromGitter>
<bararchy> We have class hierarchy and inherent , also structs and abstract classes
<FromGitter>
<bararchy> I'm also kinda dead code fanatic in the sense that I won't leave any future use code or experiment in the source and we do weekly cleaning to keep the codebase to minimum
<FromGitter>
<j8r> @bararchy what type of application is it?
<FromGitter>
<bararchy> "Cognitive Fuzzer" we use offensive cyber tools and technologies with machine learning algorithms to automate security testing and 0day detection
<FromGitter>
<j8r> sounds amazing :-D
<FromGitter>
<j8r> is it open source (yet)?
<FromGitter>
<bararchy> Haha no, were a private company , but we do open source many things
<FromGitter>
<bararchy> github.com/NeuraLegion
<FromGitter>
<j8r> and how the company has embraced crystal? someone (you?) pushed it?
<FromGitter>
<j8r> I see you probaly use FANN for Machine Learning, it seems no longer maintained. Why have chosen it?
<FromGitter>
<bararchy> We made our own, take a look at SHAInet @j8r
<FromGitter>
<j8r> ok, I suppose you moved from FANN and build SHAInet - nice!
That_Guy_Anon has joined #crystal-lang
<FromGitter>
<girng> i love CRYSTAL !
<FromGitter>
<Sjoerrdd> Same here 😍
<FromGitter>
<j8r> @girng and you also love @oprypin 😁
<FromGitter>
<girng> ahahahaa
sz0 has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<girng> "Don't worry about a memory leak, it's the job of the GC to cleanup the Character instances when they are no longer used." ⏎ ⏎ does this mean the GC re-uses old memory blocks that arn't used, and re-used that segmented data? so the memory doesn't increase infinitely, right?
<OvermindDL1>
That is a big point of pooling GC's yes
<FromGitter>
<girng> so new classes tht get increased <DB_Chracter(MEMORYADDRESSHERE)> are basically being pooled and the GC takes care of them
<OvermindDL1>
j8r: RC's can be pooling as well, this is mostly just a pooling feature
alexherbo2 is now known as alex``
<OvermindDL1>
girng: Yep
<FromGitter>
<girng> @OvermindDL1 but the memory addresses are all new. do they eventually go back to the old memory address block at some point? I imagine if they keep creating new memory blocks the usage will get higher and higher
<FromGitter>
<girng> (when you do puts class)
<FromGitter>
<girng> you can see the memory address space that is allocated
<OvermindDL1>
Probably just not got to a point where the GC has run yet to let it reuse, it allocates in large Pages (if I recall right from the ol' hans-bohem collector)
<OvermindDL1>
And it generally only marks and sweeps when a certain percentage of it is used
<FromGitter>
<girng> i see. so when we are utilizing the db module and doing `result = db.query_one? "MYSQLQUERYHERE" as: DB_Character` ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but, when you do puts `results`, you get `#<DB_User:0x1cb1c00>`, and the `0x1cb1c00` changes each time. It's a new memory block. that is normal? [https://gitter.im/crystal-lang/crystal?at=5acfa0d17c3a01610dd6f3ed]
<FromGitter>
<girng> but why does it need to create a new memory block / new address space when the mapping is all static values, doesn't make sense to me
fryguy9 has joined #crystal-lang
<FromGitter>
<bararchy> @girng what is `cc` in the char page ?
<FromGitter>
<girng> character class
<FromGitter>
<bararchy> Oh, int8 ? :)
<FromGitter>
<girng> lol
<FromGitter>
<bararchy> What if you will want to make an expansion with 'necrodruidarchwarriro' and be left without unique numbers ? :)
<FromGitter>
<girng> that was part my of my premature optimization of all evil...
<FromGitter>
<girng> i was assigning hcaracter class to an integer, to read from a dictionary by key... to save space
<FromGitter>
<girng> it's an old remnant / issue i have, im sorry for it
<FromGitter>
<girng> but, crystal has made me think better of that now =]
<crystal-gh>
[crystal] sdogruyol closed pull request #5935: Include type restriction on getters in JSON/mapping (master...json-type) https://git.io/vxd7G
<oprypin>
girng, hey u can do `macro everything_mapping(a); JSON.mapping(a); DB.mapping(a); end`
<FromGitter>
<girng> wat is this sorcery
<RX14>
oprypin: until you need to do anything even slightly different between the two and then you have a big diff undoing your usage of the macro
<oprypin>
it's still going to be a huge mess even without the macro
<FromGitter>
<evandrojr> Guys when I just add crystal binary to path, I get this error trying to compile: /usr/bin/ld: cannot find -lpcre collect2: error: ld returned 1 exit status. If I install via apt it works fine. I am using Linux Mint 18 that is compatible with Ubuntu 16.4. Does any of you have a clue about it?
<FromGitter>
<evandrojr> It is probably some dependency missing in Ubuntu.
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
<FromGitter>
<straight-shoota> `mapping` are macros. They will not evaluate `temp_data` at runtime. It needs to be a macro variable and expanded as argument.
<FromGitter>
<girng> well that kinda defeats the purpose of a macro im not going to pass in my object through the method.. code will extremely messy imo
<FromGitter>
<girng> ima just go back to what i had,, tyhx though i tried
That_Guy_Anon has quit [Remote host closed the connection]
<oprypin>
girng, sorry. I made a mistake. and the full example would be https://carc.in/#/r/3v6o
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
qard has quit [Client Quit]
<FromGitter>
<girng> @oprypin sorry had gitter closed
<FromGitter>
<girng> okay cool, i'll use that for now. thanks a bunch, lol
<FromGitter>
<girng> i tried man :P
<FromGitter>
<bew> RX14 oprypin, no need to copy everything, you can also do that: https://carc.in/#/r/3v7d