popa.bogdanp
2020-2-6 08:19:05

I’m trying it out now and it’s awesome!


soegaard2
2020-2-6 16:22:50

@greg I am impressed it’s possible without evaluating the module.


greg
2020-2-6 16:24:32

To be clear, and give credit where it’s due, the heavy lifting is mostly from drracket/check-syntax.


greg
2020-2-6 16:25:33

I did extend those results a bit, e.g. to find completion candidates for imports (taking into account the various prefix/renaming/except-ing require forms).


greg
2020-2-6 16:25:51

And there is a lot of work to stitch things together and try to get the UX I want.


greg
2020-2-6 16:26:13

So it’s been about 70 commits of exploring and refining over some weeks.


greg
2020-2-6 16:26:28

But again the core “magic” is from drracket/check-syntax.


soegaard2
2020-2-6 16:27:36

Well - I am still impressed!


greg
2020-2-6 16:29:02

I am pretty happy with it so far — including dogfooding it when editing the Racket half of Racket Mode. Having said that I’m still polishing and fixing bugs, so, that check-syntax branch is still a bit WIP atm.


greg
2020-2-6 16:30:17

When things settle down, I will see if there are some things I could contribute back into drracket/check-syntax itself.


greg
2020-2-6 16:31:16

One is that identifier-binding doesn’t always understand provides that are both renamed and wrapped in contracts. I have strategies to work around that, but it would be nice to improve that at the root (if possible).


soegaard2
2020-2-6 16:33:31

At least you have figured out what causes the problem. I imagine there is a lot of corner cases.


greg
2020-2-6 16:38:32

For example, try (require net/url) and then do (identifier-binding #'get-pureport). The answer is: '(#<module-path-index:net/url> provide/contract-id-get-pure-port.1 #<module-path-index:net/url> get-pure-port 0 0 0) So the “nominal-id” is get-pure-port and the “source-id” is provide/contract-id-get-pure-port.1. The latter is technically correct, but not helpful if you want to search in that file (either textually or syntax-ually) to find the definition location. I suppose this is more about identity — when is a thing and a chaperone of the thing the “same” or “different” — and not about identifier-binding per se. But it would be nice to have an off-the-shelf way to handle it.


greg
2020-2-6 16:39:53

And given that piece, it would be easy for Dr Racket’s “Open Defining File” to be a true “goto-definition within that file” like I do in Racket Mode. So I’d like to contribute that back, somehow.


soegaard2
2020-2-6 16:41:11

Sound like a new time. Like for-docs is for documentation, you need a for-reading which specifies where to look, while reading the code.


greg
2020-2-6 16:42:29

Hmm right now I’m wondering if provide/contract and contracted-out leave some clue in the expanded syntax, like a syntax property, as to what syntax they’re wrapping? If not, maybe they could start doing so. Then could use that syntax’s location. Something like that.


soegaard2
2020-2-6 16:48:05

Sounds like the right place to look. I don’t know if it is at all helpful, but there were an Inside Racket Seminar a few years back: https://www.youtube.com/watch?v=eUsDKbKtrLs


jestarray
2020-2-6 18:27:45

do most of you guys here use emacs as an alternative to drrracket ?


raymond.machira
2020-2-6 18:39:54

hey Team, I am working on a dsl, is this the right channel to get help?


jestarray
2020-2-6 18:40:20

only other channel i see is random lol, so fire away


sorawee
2020-2-6 18:43:13

Sorry, I don’t know an answer to that. @mflatt, do you know?


brentgordon146
2020-2-6 19:14:23

yes i use emacs


mflatt
2020-2-6 19:18:08

It’s difficult to know whether the changes are relevant to @massung’s use, but a lot has changed since v7.4. One fix in particular repairs a cache that sits between the namespace resolver and the filesystem; since filesystem metadata operations tend to be slower on Windows, the repair could make even more of a difference there. But it depends on what was slower.


slack1
2020-2-6 20:24:56

I’d consider emacs but people keep suggesting the demand for configuration is overwhelming


soegaard2
2020-2-6 20:26:16

Do we have a “substitute” or “replace” function that works on trees (lists of lists). Something like (substitute t x y) will replace all leafs in the tree t which equal to x with the value y?


soegaard2
2020-2-6 20:28:10

jestarray
2020-2-6 21:22:22

agreed lol, getting started with emacs looks daunting..


sorawee
2020-2-6 21:23:40

There’s Spacemacs which I think is super friendly to people who are new to Emacs.


massung
2020-2-6 21:33:51

Well, I look forward to 7.6 then and finding out. :slightly_smiling_face:


slack1
2020-2-6 21:35:34

that makes me more nervous that I’m on some weird emacs away from mainstream knowledge


slack1
2020-2-6 21:35:51

and that advice over the web will interact with this strange mode


jestarray
2020-2-6 21:35:56

i tried spacemacs before it eh… kind of bloated


jestarray
2020-2-6 21:36:13

elisp is also slower than javascript iirc :s


nbtheduke
2020-2-6 21:50:04

when reading the racket docs, is it possible to view the source code for a given form?


nbtheduke
2020-2-6 21:50:42

for example, clojuredocs has the (source) link in the upper right corner (https://clojuredocs.org/clojure.core/reduce), which links to the line where it’s defined


shu--hung
2020-2-6 21:52:25

not that I know of, but I’d try opening DrRacket, type in the identifier and right-click “jump to definition”


nbtheduke
2020-2-6 21:53:44

oh cool, thanks


soegaard2
2020-2-6 22:12:47

@nbtheduke DrRacket: Maybe click the “check syntax” icon first, then right click and choose “jump to definition”.


soegaard2
2020-2-6 22:13:52

In racket-mode you can use M-. to visit a definition and M-, to go back.


nbtheduke
2020-2-6 22:16:16

In drracket?


soegaard2
2020-2-6 22:16:33

The first line is for DrRacket. The second is for emacs.