<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> 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…]
<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> 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…]
<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