ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.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
fyber has joined #crystal-lang
pdkl has quit [Remote host closed the connection]
f1refly has quit [Ping timeout: 246 seconds]
f1reflyylmao has joined #crystal-lang
_whitelogger has joined #crystal-lang
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #crystal-lang
firejox has joined #crystal-lang
elliotize has joined #crystal-lang
<elliotize> So I have a question about macros
<elliotize> what's the best way to clean up macros at the moment and is there a way to easily separate out the into methods?
nowhereFast has joined #crystal-lang
<FromGitter> <stergiom> ```code paste, see link``` ⏎ ⏎ would this be considered idiomatic for Crystal? [https://gitter.im/crystal-lang/crystal?at=5d96cf1f7aa5602ffc669e57]
elliotize has quit [Remote host closed the connection]
ht_ has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
nowhereFast has left #crystal-lang [#crystal-lang]
ht_ has quit [Quit: ht_]
Stephie has quit [Quit: Fuck this shit, I'm out!]
<FromGitter> <ImAHopelessDev_gitlab> sure
<FromGitter> <ImAHopelessDev_gitlab> there is talk about [} of syntax on github, but if it's used in the source at some locations
<FromGitter> <ImAHopelessDev_gitlab> (and i've seen it be used a lot)
Stephanie has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> @elliotize, hmm @Blacksmoke16 can def help you with that macro question
rohitpaulk has joined #crystal-lang
pf_ has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter> <Val> https://carc.in/#/r/7oyg at home compilation takes about 4GB RAM and for time : time crystal run hello.cr |grep -iv hello ⏎ ⏎ real0m10.543s ⏎ user0m14.579s ⏎ sys0m0.742s [https://gitter.im/crystal-lang/crystal?at=5d9709949735874673f36ba3]
<FromGitter> <Val> ( from : https://christine.website/blog/compile-stress-test-2019-10-03 ) Crystal is better than Rust ;-)
<FromGitter> <ImAHopelessDev_gitlab> interesting
ua_ has quit [Ping timeout: 276 seconds]
alex`` has joined #crystal-lang
<alex``> do you have a name suggestion for a project which does enable to execute shell commands via websocket?
<alex``> I have a similar project for chrome called 'chrome-shell'
<alex``> but dunno for this one
<alex``> 'websocket-shell' ?
<alex``> 'shell-websocket' ?
<FromGitter> <ImAHopelessDev_gitlab> websocket-shell
<FromGitter> <j8r> wssh
<FromGitter> <j8r> but already taken https://github.com/search?utf8=%E2%9C%93&q=wssh
<alex``> ImAHopelessDev_gitlab: I’m not native english, what is the difference in the order websocket <-> shell?, and how would you describe it in a short description for github
<FromGitter> <absolutejam_gitlab> RemoteCodeExecution
<FromGitter> <absolutejam_gitlab> 😉
<alex``> j8r: I’m not too fond of abbreviations
<alex``> I avoid them as possible
<FromGitter> <absolutejam_gitlab> shellsocket
<alex``> absolutejam_github: socket is really different than websocket no?
<alex``> we lost something in the name nan?
<FromGitter> <absolutejam_gitlab> eh, you gotta take some liberties when naming things
<FromGitter> <absolutejam_gitlab> shlskt.io
<FromGitter> <absolutejam_gitlab> remove vowels, make it hipster
<alex``> btw is it the same absolutejam than kakoune? ;o
<alex``> and for the 'short description'?
<FromGitter> <absolutejam_gitlab> in IRC?
<alex``> dunno
absolutejam has joined #crystal-lang
<alex``> I know an absolutejam in the kakoune community
<FromGitter> <absolutejam_gitlab> yeah but I haven't opened IRC in a while, oops
<FromGitter> <ImAHopelessDev_gitlab> @alex, dunno. rolls better off the tongue for me. plus, `websocket` being the first word implies that's the essential part of your app maybe? which is a core thing, without websocket it wouldn't work. i don't know lol
<alex``> makes sense
<alex``> hm
<alex``> I have a question about websocket to execute shell commands
<alex``> the idea is to have surf to execute from javascript ~/.surf/script.js externals commands on my system
<alex``> but if a webpage have a js code connecting on localhost, port, it will be able to execute external commands on my machine no?
<alex``> how can I secure the thing?
<alex``> to only me be able to exchange messaging through websocket
<FromGitter> <ImAHopelessDev_gitlab> yeah not sure about internals but could be a security issue if the commands are not cleaned/parsed. i guess, maybe an option to create a whitelist instead. only allow certain commads
<FromGitter> <absolutejam_gitlab> I know very little about how websockets actually work, but can't you have a standardised format - eg. accept JSON - and a router/validator that parses them?
<FromGitter> <absolutejam_gitlab> I'd be wanting some hardcore security around this though, otherwise it's just wide-open RCE
<FromGitter> <ImAHopelessDev_gitlab> yea lol ^^^
<alex``> ImAHopelessDev_gitlab: I want to execute any shell commands
<alex``> but want to be secure
<FromGitter> <ImAHopelessDev_gitlab> hmmm
<alex``> if I navigate on a page, and it use javascript localhost connection + port, it will be able to execute commands on my system
<alex``> I don't have this problem on chrome and firefox because they have their own api
<oprypin> @jwoertink: no, on latest SFML :D
<alex``> but on surf browser, there is no way to execute shell commands from javascript with an api
<alex``> so I thought about websocket
<alex``> but could be a terrible idea
rohitpaulk has joined #crystal-lang
absolutejam has quit [Ping timeout: 276 seconds]
absolutejam has joined #crystal-lang
<FromGitter> <j8r> alex: depends, abbreviations are everywhere on the CLI
<FromGitter> <j8r> in code, it doesn't hurt to have longer names
<FromGitter> <Blacksmoke16> @stergiom https://crystal-lang.org/api/master/Enumerable.html#each_with_object(obj,&block)-instance-method might be able to use that as well
<FromGitter> <Blacksmoke16> elliotize: you can share variables within the same macro "scope", but there isn't a way to break out logic into reusable functions atm
Vexatos has quit [Quit: ZNC Quit]
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
masterdonx2 has joined #crystal-lang
MasterdonX has quit [Ping timeout: 246 seconds]
masterdonx2 has quit [Ping timeout: 265 seconds]
pf_ has quit [Ping timeout: 240 seconds]
firejox has quit [Quit: WeeChat 2.5]
MasterdonX has joined #crystal-lang
masterdonx2 has joined #crystal-lang
MasterdonX has quit [Ping timeout: 276 seconds]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
HumanGeek has quit [Ping timeout: 240 seconds]
pf_ has joined #crystal-lang
duane has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <ilanpillemer> ```code paste, see link```
<FromGitter> <Blacksmoke16> whats the error
<FromGitter> <tenebrousedge> D: you broke it!
<FromGitter> <ilanpillemer> This is just from trying to build it from master
<FromGitter> <ilanpillemer> I did nothing. I just pulled from master and tried
<FromGitter> <Blacksmoke16> it would be towards the top above the `??`
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d9754e7b385bf2cc671756f]
<FromGitter> <ilanpillemer> and then a long list of froms
<FromGitter> <Blacksmoke16> on mac?
<FromGitter> <ilanpillemer> ending
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d97551f0e67130aae12d4ca]
<FromGitter> <ilanpillemer> on a mac
<FromGitter> <ilanpillemer> and I got llvm from homebrew
<FromGitter> <Blacksmoke16> `crystal --version`
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d97554c37073b36a06c885b]
<FromGitter> <Blacksmoke16> `brew info crystal` (just the first line)
<FromGitter> <Blacksmoke16> er first few lines, include down to `Options`
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d975595fcf7602cc52e19f2]
<FromGitter> <Blacksmoke16> try updating to newest version, brew PR got merged yesterday
duane has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> that error was from when brew installed llvm9, which crystal doesnt support yet
duane has joined #crystal-lang
<FromGitter> <ilanpillemer> it failed again
<FromGitter> <ilanpillemer> should I install a different llvm?
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d9758bd464b432fc1bb5fd5]
<FromGitter> <asterite> you need llvm 8
<FromGitter> <asterite> homebrew takes care of that in the latest crystal formula
<FromGitter> <ilanpillemer> hmm.. it didnt seem to
<FromGitter> <Blacksmoke16> hm when i updated it, it downloaded 8 and removed 9
<FromGitter> <Blacksmoke16> `brew cleanup` maybe?
<FromGitter> <Blacksmoke16> might have been i just didnt do that in a while and it did it for me
<FromGitter> <ilanpillemer> I installed llvm with brew install, maybe thats an issue
<FromGitter> <Blacksmoke16> i.e. llvm on its own?
<FromGitter> <Blacksmoke16> that would prob do it as that would install the latest, i.e. 9 which doesnt work yet
<FromGitter> <ilanpillemer> ok. I have both. I need to set the env so its uses llvm8
<FromGitter> <Blacksmoke16> correct
<FromGitter> <Blacksmoke16> or just uninstall 9, dont really need both? (unless you're doing other stuff with it)
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d975abce8de6f3ca03b3dcf]
<FromGitter> <ilanpillemer> it started like this..
<FromGitter> <ilanpillemer> so looks right now
<FromGitter> <Blacksmoke16> 👍 cool
<FromGitter> <tenebrousedge> 👍
<FromGitter> <Blacksmoke16> also be sure to use `./bin/crystal/` as the built binary
<FromGitter> <ilanpillemer> 👍
<FromGitter> <ilanpillemer> aww
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d975b729735874673f5c98a]
<FromGitter> <ilanpillemer> trying again
<FromGitter> <ilanpillemer> ok.. tests are now running finally. :)
pf_ has left #crystal-lang [#crystal-lang]
ua has joined #crystal-lang
<FromGitter> <Blacksmoke16> nice one
absolutejam has quit [Ping timeout: 250 seconds]
Yxhuvud has joined #crystal-lang
<FromGitter> <ilanpillemer> there a 4 tests that fail.. but I think they can be ignored
<FromGitter> <ilanpillemer> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d9763ba874aeb2d23e9abf1]
Vexatos has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> I made a chat server video, I hope it becomes popular so more people find out about Crystal
duane has quit [Ping timeout: 240 seconds]
ht_ has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 252 seconds]
<FromGitter> <ilanpillemer> ```code paste, see link``` ⏎ ⏎ And then when I tried again.. it worked… [https://gitter.im/crystal-lang/crystal?at=5d978208e8de6f3ca03c683d]
alex`` has joined #crystal-lang
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> LOL (https://i.redd.it/54aa8jv3niq31.jpg)
<FromGitter> <ImAHopelessDev_gitlab> hi @Blacksmoke16 what have you been up to lately
<FromGitter> <wontruefree> I just found this https://crystal-lang.org/2015/03/04/internals.html
<FromGitter> <wontruefree> it is a little long of a read
<FromGitter> <wontruefree> but worth it
<FromGitter> <wontruefree> one of the best breakdowns of crystal internals I have found
<FromGitter> <Daniel-Worrall> Though a bit fated
<FromGitter> <Daniel-Worrall> Dated
<FromGitter> <tflem> I finally figured out my problem with postgres! I had to make some changes in the hba config file lol.
<FromGitter> <tflem> Woops wrong channel sorry people.
DTZUZO has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 265 seconds]
alex`` has joined #crystal-lang
<FromGitter> <ilanpillemer> I wrote a crystal formatter for the acme editor so that crystal files get reformatted on save. Is there someone I should add this so others can know about it?
<FromGitter> <kinxer> Maybe the forum?
ht_ has quit [Remote host closed the connection]
<FromGitter> <ilanpillemer> the wiki?
<FromGitter> <ilanpillemer> I added a link to it in the wiki section for editors
absolutejam has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <ilanpillemer> how do you convert an array of chars to a string?
<FromGitter> <Blacksmoke16> arr.map &.to_s?
<FromGitter> <Blacksmoke16> or like join them into a string?
<FromGitter> <ilanpillemer> yes
<FromGitter> <ilanpillemer> turn a string into chars.. do some stuff.. convert back to a string
<FromGitter> <Blacksmoke16> `['a','b','c'].join`
<FromGitter> <ilanpillemer> aha.
<FromGitter> <Blacksmoke16> `str.chars`
<FromGitter> <ilanpillemer> thanks
<alex``> can someone invite me on reddit?
<alex``> why the channel is private
<FromGitter> <Blacksmoke16> hm?
<alex``> thanks
absolutejam has quit [Ping timeout: 276 seconds]
ua has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> @ImAHopelessDev_gitlab mostly my serialization shard and some other stuff here and there
<FromGitter> <ImAHopelessDev_gitlab> @Blacksmoke16 nice you work on that a lot huh
<FromGitter> <ImAHopelessDev_gitlab> kinda like my game ;p
<FromGitter> <ImAHopelessDev_gitlab> you prob got more proper code in serialization shard than my entire gameserver 😆
<FromGitter> <Blacksmoke16> is taking a while yea, serialization side of it is done for the most part. doing deserialization now
<FromGitter> <ImAHopelessDev_gitlab> that i've been working on for year+ (well, 2 if you count nodejs years). and you only been doing serialization shard for 6 months or so right
<FromGitter> <ImAHopelessDev_gitlab> oh god
<FromGitter> <Blacksmoke16> more like just 2 months for the refactor
<FromGitter> <ImAHopelessDev_gitlab> ic
<FromGitter> <ImAHopelessDev_gitlab> wait, what did you have to refactor?
<FromGitter> <ImAHopelessDev_gitlab> conform code to new crystal updates?
<FromGitter> <ImAHopelessDev_gitlab> or api overhaul or something
alex`` has quit [Quit: WeeChat 2.6]
<FromGitter> <ImAHopelessDev_gitlab> found it ;D
<FromGitter> <Blacksmoke16> the refactor branch
<FromGitter> <Blacksmoke16> changing the implementation
<FromGitter> <Blacksmoke16> also split out the assertions stuff into its own shard
<FromGitter> <ImAHopelessDev_gitlab> i finished reading the c book by dennis ritchie and brian kernighan (https://github.com/germanoa/compiladores/blob/master/doc/ebook/The%20C%20Programming%20Language%20-%202nd%20Edition%20-%20Ritchie%20Kernighan.pdf). i could only complete 2 exercises. there is also no `Hash` Type like in crystal. when i got to the `struct key` section, my brain exploded and i rage-quit. however, the section
<FromGitter> ... regarding pointers was really well-written and much better than any stackoverflow answer i've ever read. i want to buy/read a book by brian/asterite or people who are well versed in crystal. i think it would be very insightful.
<FromGitter> <ImAHopelessDev_gitlab> cya you tomorrow @Blacksmoke16
<FromGitter> <Blacksmoke16> o/