haakonhr
2021-2-25 11:29:07

Is anyone using rash as their main shell (https://rash-lang.org/)? I’ve been playing around with it the last days to do standard shell stuff, json stuff and simple computations interactively and I really like it, e.g. mapping functions onto piped lists read from a json file. E.g.: jq .data.some_list some.json \|> port->string \|> string->jsexpr \|> (map some_function_defined_in_the_session)


greg
2021-2-25 14:31:29

@samth I opened an issue with some initial data and thoughts. https://github.com/greghendershott/racket-mode/issues/522


greg
2021-2-25 14:31:52

I’m still at the stage where I can make progress doing more experiments, doing more thinking, and doing more deliberate not-thinking (i.e. letting this bounce around in my subconscious for some number of days, waiting for ideas to bubble up).

So I’m not necessarily looking for feedback or ideas; but also welcome any that anyone might have.


samth
2021-2-25 14:42:15

I commented on the issue


katar38
2021-2-25 15:01:53

@katar38 has joined the channel


ben.knoble
2021-2-25 16:47:24

Why does read-line always return "" in the REPL and how can I use it (or something similar) to temporarily hijack stdin for a custom repl? I wrote something like (define (repl) (let ([input (read-line)]) (unless (eof-object? input) (print (eval-top input)) (repl)))) where eval-top is a custom function


soegaard2
2021-2-25 16:56:06

Have you looked at read-eval-print-loop and friends?



ben.knoble
2021-2-25 16:59:21

Hm, thanks, I’ll give that whirl


soegaard2
2021-2-25 17:09:43

A “real” terminal inside DrRacket would be great though. Didn’t someone work on a terminal?


ben.knoble
2021-2-25 17:11:03

I wasn’t able to get too far here; I couldn’t change the prompt even with (parameterize ([current-prompt-read (λ () (print "524-lang> ") (let ([in ((current-get-interaction-input-port))]) ((current-read-interaction) (object-name in) in)))]) (read-eval-print-loop)) and my eval-top ’s interface is to take a string, which it parses itself. I couldn’t figure out how to get the reader to fit that.


soegaard2
2021-2-25 17:13:38

I think, you need to change current-read-interaction too.


ben.knoble
2021-2-25 17:30:54

Pretty hacky, but it works for me :slightly_smiling_face: (define (repl) (parameterize ([current-read-interaction (λ (_ in) (read-line in))] [current-eval (λ (e) (when (non-empty-string? (cdr e)) (eval-top (cdr e))))]) (read-eval-print-loop))) cdr because everything is (#%top-interaction . value)


anything
2021-2-25 19:24:31

I did try to install it on Windows, but did not make it. I don’t have libedit.dll, so I tried to install libreadline–5.dll, but the copy I found for Windows was considered an invalid Win32 application, so it did not run. I’m willing to try again, but I need to get some tasks done first. I suppose this weekend might be the best time I’ll have. We’ll see.


frederic.espiau
2021-2-25 20:31:02

@frederic.espiau has joined the channel


sorawee
2021-2-25 22:07:27

@greg is there a way to hide “tail” tooltips in Racket Mode?


greg
2021-2-26 00:03:39

Not yet. There’s a pair of faces for them you can customize, but, that doesn’t affect showing the tooltip. Too noisy for you? I’ve been on the fence about that myself.


sorawee
2021-2-26 01:13:43

Yeah, it’s kinda too noisy for me.


sorawee
2021-2-26 02:04:02

I don’t mean to say it should be taken out. Perhaps it’s useful for some people. But having a configuration to disable just the “tail” tooltip would be nice


katar38
2021-2-26 04:07:08

what does this tooltip mean? I find it noisy too plus I don’t understand it :laughing:


sorawee
2021-2-26 04:28:10

Say, you have

(if #t 1 2) then 1 is in the tail position w.r.t. (if #t 1 2).

In DrRacket, there will be an arrow from 1 to (if #t 1 2). Racket Mode tries to simulate the arrow by using face + tooltip.


katar38
2021-2-26 04:33:53

I see, thanks! then I confused it with another tooltip, this one:


katar38
2021-2-26 04:35:36

I see it at the start of every define


sorawee
2021-2-26 04:41:28

That one is essentially the other end of the arrow.


katar38
2021-2-26 04:42:22

I see, thank you