ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | Fund Crystal's 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
greengriminal has quit [Quit: Leaving]
<FromGitter> <bew> @oprypin it's not compile-time crash, it's runtime!
<FromGitter> <bew> @zatherz no, not possible, because it's not possible to define a macro method callable from a macro statement (inside `{% %}` or `{{ }}`)
<DissonantGuile> Using this code `Process.exec("/bin/echo foo")`, I get this error 'execvp: No such file or directory (Errno)'
<DissonantGuile> Works fine when I run `/bin/echo foo` in my terminal, what's going on?
<FromGitter> <zatherz> aren't args a separate array?
<FromGitter> <zatherz> try this
<FromGitter> <zatherz> `Process.exec("/bin/echo", ["foo"])`
<FromGitter> <zatherz> btw
<FromGitter> <zatherz> ```puts `/bin/echo "foo"```` ⏎ ⏎ is a thing too [https://gitter.im/crystal-lang/crystal?at=59505733ceb5bef82eae1f8c]
<FromGitter> <zatherz> Oh wait no Process.exec is like `exec`
<FromGitter> <bew> DissonantGuile are you sure you want to exec the program (and replace the crystal process, stopping everything running), or do you just want to run a program and get it's output?
<DissonantGuile> Yeah I'm trying to wrap around `cd`, `Process.exec("/usr/bin/cd", [path])` seems to run but not actually change the working directory in the terminal
<FromGitter> <zatherz> cd is a builtin in most shells
<DissonantGuile> Yes I'm finding that out the hard way
<FromGitter> <zatherz> as in, when you run `cd abc` in bash, you don't actually run any external process
<FromGitter> <zatherz> it's why `sudo cd ...` doesn't work either
<FromGitter> <bew> You want `Dir.cd("/tmp")`
<FromGitter> <bew> to move the crystal process into `"/tmp"` directory
<FromGitter> <zatherz> that will change the directory for the current process
<DissonantGuile> That only changes for the current script
<DissonantGuile> Making a simple bookmark app `bm add foo /foo` then `bm cd foo`, everything works except changing directories because builtin
<FromGitter> <zatherz> I think apart from bash specific wrappers there's nothing you can do
<FromGitter> <bew> you can't change the CWD (current working directory) of your shell from another program but the shell itself (using bash or zsh or any language your shell is)
Kug3lis has joined #crystal-lang
<FromGitter> <zatherz> so like, `bm` would have to be a bash function
<DissonantGuile> Yeah it started as a zsh function I created awhile back
<FromGitter> <bew> @zatherz don't edit you messages, IRC users don't see edits
<DissonantGuile> Welp.. guess I gotta repurpose this app for something else then heh
Kug3lis is now known as Kug3lis_off
<FromGitter> <bew> You could hack something that could work with a custom shell setup (waiting for input from a pipe or a unix-socket in zsh, and cd-ing into that input when it gets some), then passing the pipe or the unix address using ENV vara=s to the `bm` process, then from your process, connect to the parent shell through the pipe/socket and send the directory you want to cd to... But this a hack that would work only with zsh,
<FromGitter> ... with a custom setup..
<FromGitter> <bew> s/vara=s/vars
<DissonantGuile> Maybe exec a subshell instead hmm
<FromGitter> <zatherz> but then you're gonna get a new subshell
<FromGitter> <zatherz> every single time you run the command
<DissonantGuile> Yeah different functionality, would have to just remember to `exit` to back out
<FromGitter> <bew> or to know that you're in a subshell (using ENV vars like IN_BOOKMARK or sth), and exit automatically when you want to cd (and reopen another subshell)
<FromGitter> <bew> if you get your muscle memory to `exit` when you want to backout, good luck to use a normal shell after that x)
<DissonantGuile> Such a bummer, only other option is to open a new terminal window with the dir
<FromGitter> <bew> do you know `cdr` and `z` for that kind of bookmarking thing?
<DissonantGuile> Nope, I was just practicing cr a bit
<FromGitter> <bew> ok then, have fun ;)
_whitelogger has joined #crystal-lang
ishahnaz has joined #crystal-lang
ishahnaz has quit [Client Quit]
yogg-saron has joined #crystal-lang
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yogg-saron has joined #crystal-lang
tilpner has joined #crystal-lang
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yogg-saron has joined #crystal-lang
balduin has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
hightower2 has joined #crystal-lang
<hightower2> Howdy fine gents
flaviodesousa has joined #crystal-lang
balduin has quit [Ping timeout: 268 seconds]
<FromGitter> <delef> https://github.com/delef/geoip2.cr/blob/master/test.cr#L25 ⏎ I have some error. You faced with this?
<FromGitter> <delef> Invalid memory access (signal 11) at address 0x7faa5f278790 ⏎ [0x10a90c98b] *CallStack::print_backtrace:Int32 +107 ⏎ [0x10a8f7d5c] __crystal_sigfault_handler +60 ⏎ [0x7fff977c5b3a] *sigtramp +26 ⏎ [0x10a93ffda] *Pointer(Hash::Entry(Tuple(UInt64, Symbol), Bool) | Nil)@Pointer(T)#[]<Int32>:(Hash::Entry(Tuple(UInt64, Symbol), Bool) | Nil) +10 ... [https://gitter.im/cr
<FromGitter> ... ystal-lang/crystal?at=5950bea3c101bc4e3a1ff5ec]
RX14 has quit [Ping timeout: 260 seconds]
<FromGitter> <bew> @delef Can you write an `else` case that raise an error for https://github.com/delef/geoip2.cr/blob/master/test.cr#L11 to be sure you don't have anything but a String
<crystal-gh> [crystal] akzhan opened pull request #4624: Intrinsics now platform dependent. PtrdiffT type introduced. (master...ptrdiff_t) https://git.io/vQ3dV
hightower2 has quit [Ping timeout: 240 seconds]
hightower2 has joined #crystal-lang
<FromGitter> <akzhan> Thanks @faustinoaq for your example and VSCode extension.
Philpax has joined #crystal-lang
<FromGitter> <bew> @delef it's weird, when I add `pp @result` in the initialize, after initializing `@result` it crashs like your error, and I can't reproduce in a minimal environnement, don't know what's going on..
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
hightower2 has quit [Ping timeout: 260 seconds]
<FromGitter> <zatherz> you're working with `uninitialized` and pointers, so it might be a memory corruption before that
balduin has joined #crystal-lang
<FromGitter> <lilijreey> @akzhan Do you think let crystal support Interactive shell Read-Eval-PrintLoop?
<FromGitter> <lilijreey> How to debug crystal code? I user gdb but can't debug crystal code.
rohitpaulk has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
<FromGitter> <schoening> Will crystals parallelism be able to share references to data like currently in the concurrency way or is that impossible ? I never worked multithreaded before :p
jokke has quit [Quit: WeeChat 1.7.1]
<FromGitter> <bew> For fiber communications (across 1 or more threads when parrallelism
<FromGitter> <bew> parallelism will be a thing)
<FromGitter> <bew> You should use Channels
jokke has joined #crystal-lang
<FromGitter> <bew> You can share references, but to prevent race conditions, you would need some locks, semaphores, and channels already handle that if needed
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
rohitpaulk has quit [Ping timeout: 255 seconds]
<FromGitter> <akzhan> @lilijreey it should be great. Golang has https://github.com/motemen/gore for example. ⏎ ⏎ Moreover it is interesting to run Crystal code through llvm-jit for these purposes. But it shouldn’t be easy to build.
rohitpaulk has joined #crystal-lang
<FromGitter> <akzhan> Yet another task is AST generation for code completions etc. It should parse incomplete code.
chimkan has joined #crystal-lang
chimkan has left #crystal-lang [#crystal-lang]
chimkan has joined #crystal-lang
<FromGitter> <lilijreey> @schoening You need understand the CSP cparallelism mode used by Golang, Crystal,Erlang
<FromGitter> <zatherz> nothing better than a 300 line macro
<FromGitter> <schoening> I'll google it after work thx @chuanshuo (feel free to text me your wisdom unless you are busy :smile: )
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 255 seconds]
<FromGitter> <schoening> Hehe, ok I found this pretty funny https://play.crystal-lang.org/#/r/298i
<FromGitter> <bew> haha!!!
<FromGitter> <davidbe> @schoening emoji-based programming?
<FromGitter> <schoening> Man.. now I want to write a program that only uses emojis hahha
<FromGitter> <schoening> Yeah :D haha
<FromGitter> <schoening> Didn't look good in sublime tho, I assume Atom will support them properly coz its web based. I try later from home
<FromGitter> <bew> good luck for debugging :D
<FromGitter> <schoening> Oh damn... 😂
<FromGitter> <schoening> I'm making a very simple game server. Maybe emojis will actually be useful. A sort of half way there visual language? 😂
<FromGitter> <bew> emoji DSL to build emoji based games ><
Kug3lis has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <schoening> Haha oh god..
<FromGitter> <zatherz> nearly 400 lines of macros for a json parser generator >.<
greengriminal has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <zatherz> at the very least I finally have a sane JSON parser generator https://pastebin.com/5Rt8fC4n
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter> <bew> nice! possible to see it?
greengriminal has joined #crystal-lang
<FromGitter> <zatherz> Yeah, I'm gonna put it up on my gitlab in a moment
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
tzekid has joined #crystal-lang
yogg-saron has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
balduin has quit [Quit: Leaving.]
RX14 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Remote host closed the connection]
greengriminal has joined #crystal-lang
greengriminal has quit [Remote host closed the connection]
yogg-saron has quit [Quit: Textual IRC Client: www.textualapp.com]
greengriminal has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
<FromGitter> <krypton97> what's the recommended way to server static files with crystal?
<FromGitter> <fridgerator> In the instance of Kemal, you ship the folders that contain your static files along with the application executable.
<FromGitter> <fridgerator> There is also : https://github.com/schovi/baked_file_system
<FromGitter> <fridgerator> Is this what you meant?
<FromGitter> <krypton97> I mean vanilla
<FromGitter> <krypton97> I wanna get used to the standard lib for now..
<oprypin> krypton97, https://crystal-lang.org/api/0.22.0/HTTP/Server.html search page for StaticFileHandler
<oprypin> krypton97, also note that standard library code is not special in any way
<oprypin> both standard library and normal code are all put together and compiled
<FromGitter> <peterschols> Hi, ⏎ Is anyone developing Crystal in Atom and using a linter? ⏎ I'm running Atom 1.17.2 with the Crystal 0.2.1 package and Linter 2.1.4. ⏎ I'm trying to get Diagnostics to work. Crystal is in my path but Atom keeps on flashing an orange dot in the lower right corner indicating that crystal is running on my test.cr source file. It seems to keep running forever. ⏎ Running Crystal manually on the
<FromGitter> ... source file works fine. ... [https://gitter.im/crystal-lang/crystal?at=5951500957a6e9f72efff9c5]
<FromGitter> <krypton97> Thanks!
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
nikkkk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <krypton97> Btw, I know that standard lib is not special in any way, but tends to be faster
<FromGitter> <bigtunacan> @krypton97 Kemal is very fast. It is built on top of radix.
<FromGitter> <bigtunacan> It offers a lot of additional functionality for practical web applications that most people would not want to rebuild.
<FromGitter> <bigtunacan> And if you did rebuild that functionality then likely you will end up with something just as slow.
<Papierkorb> krypton97, you have to be more specific in what protocol you actually want. you might as well be referring to FTP.
<Papierkorb> krypton97, for HTTP, that'd be HTTP::Server
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<FromGitter> <krypton97> I'll do a quick benchmark with the raw http module to see how it goes
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <peterschols> :point_up: June 26, 2017 8:18 PM (https://gitter.im/crystal-lang/crystal?at=5951500957a6e9f72efff9c5) FYI this issue has been fixed by a PR https://github.com/atom-crystal/atom-crystal/pull/18/files which has not been merged yet.
Raimondi has joined #crystal-lang
ryanf_ has joined #crystal-lang
bjz has joined #crystal-lang
asd_ has joined #crystal-lang
<asd_> Is Crystal a security-first programming language?
asd_ has quit [Quit: Page closed]
bjz_ has joined #crystal-lang
<oprypin> srsly
<FromGitter> <zatherz> is it possible to "pass down" macro arguments?
<oprypin> in some cases
<FromGitter> <zatherz> I have a macro that outputs a macro
<oprypin> oh.. THAT is actually impossible, i think
<FromGitter> <zatherz> (using `\{% ... %}`)
<FromGitter> <zatherz> I tried `\{% type_decl = ({{type_decl}}) %}`
<FromGitter> <zatherz> but `Can't execute TypeDeclaration in a macro`
bjz has quit [Ping timeout: 260 seconds]
<FromGitter> <zatherz> I really didn't want to have to have a separate .cr just for documentation but looks like I'll have to do that
<oprypin> why dont you explain what you're trying to do
<oprypin> you can do anything as long as you don't have a macro that outputs a macro
<FromGitter> <zatherz> lol, it's a JSON parser generator
<FromGitter> <zatherz> vastly more complicated than JSON.mapping
<FromGitter> <zatherz> because it uses constants for storing field data and `macro finished`
bjz_ has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
<crystal-gh> [crystal] mverzilli pushed 1 new commit to master: https://git.io/vQGz2
<crystal-gh> crystal/master 11b1e3c Adam Trilling: Add headers parameter for HTTP::WebSocket constructors (#4227)
Ven has joined #crystal-lang
Ven is now known as Guest27801
tzekid has quit [Remote host closed the connection]
Guest27801 is now known as Ven```
Ven``` has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
bjz_ has joined #crystal-lang
<crystal-gh> [crystal] mverzilli closed pull request #4619: Fixed docs for gzip/writer (master...patch-1) https://git.io/vQO1Q
hako has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#11b1e3c (master - Add headers parameter for HTTP::WebSocket constructors (#4227)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/247258612
<DeBot> https://github.com/crystal-lang/crystal/pull/4227 (Add headers parameter for HTTP::WebSocket constructors)
<FromGitter> <zatherz> https://gitlab.com/Zatherz/magicjson @bew
<FromGitter> <zatherz> trigger warning: ~400 lines worth of macros
<FromGitter> <johnjansen> anyone got an example of the use of `missing_option` for OptionParser
<oprypin> johnjansen, it's just positional arguments
<oprypin> nevermind i confused things
<FromGitter> <johnjansen> haha kinda
<oprypin> johnjansen, `missing_option { |s| raise MissingOption.new(s) }` to copy the default behavior
<oprypin> or do anything else with it
<FromGitter> <johnjansen> thanks oprypin i just arrived at that myself ;-)
<oprypin> not sure what else you would do with it though
<oprypin> you could do some hacks like ignore the fact that it's missing but the parser could be busted anyway at that point
<FromGitter> <johnjansen> not quite what i was thinking either … i was looking at it as a missing option, not a missing option argument
<FromGitter> <johnjansen> but anyhoo
<oprypin> johnjansen, but that's just `invalid_option` then
<FromGitter> <johnjansen> plenty of ways around my problem, so all good
<crystal-gh> [crystal] matiasgarciaisaia pushed 1 new commit to master: https://git.io/vQGP7
<crystal-gh> crystal/master 3c3d3e2 Matias Garcia Isaia: Crystal 0.23.0 Changelog
<RX14> yay new release
<RX14> @johnjansen did you see my PM?
chimkan has quit [Quit: chimkan]
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 260 seconds]
<travis-ci> crystal-lang/crystal#bf5d462 (master - Fixed docs for gzip/writer (#4619)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/247266176
<DeBot> https://github.com/crystal-lang/crystal/pull/4619 (Fixed docs for gzip/writer)
hightower4 has joined #crystal-lang
raphaBarbo has joined #crystal-lang
hightower3 has quit [Ping timeout: 255 seconds]
<FromGitter> <straight-shoota> :clap:
nikkkk has quit [Quit: Textual IRC Client: www.textualapp.com]
Philpax has joined #crystal-lang
<travis-ci> crystal-lang/crystal#3c3d3e2 (master - Crystal 0.23.0 Changelog): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/247289118
raphaBarbo has quit [Ping timeout: 260 seconds]
greengriminal has quit [Quit: Leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]