Discussion about all editors used for Clojure/ClojureScript
cfleming 2018-07-04T02:53:30.000066Z

@hagmonk This is vaguely related to our discussion the other day: https://arxiv.org/pdf/1707.00015.pdf

cfleming 2018-07-04T02:53:45.000137Z

Although I think Prune is more along the lines of what you meant.

hagmonk 2018-07-04T02:56:07.000049Z

@cfleming oh sweet, that's pretty interesting, I'll put that on the stack of papers

cfleming 2018-07-04T02:56:15.000004Z

You can try it out here: https://ravichugh.github.io/sketch-n-sketch/releases/v0.6.3/

cfleming 2018-07-04T02:56:23.000043Z

Seems a little buggy though

cfleming 2018-07-04T02:56:50.000122Z

I’m sad they never released Prune, even if they just threw a zip over the fence.

hagmonk 2018-07-04T02:57:03.000023Z

Hah, web based - at first I was trying to recognize the UI chrome. OS/2? Irix??

cfleming 2018-07-04T02:57:36.000077Z

It does have that 80's sort of feel 🙂

hagmonk 2018-07-04T02:57:59.000051Z

"I know this … this is UNIX …"

cfleming 2018-07-04T02:58:22.000177Z

You’re quite the treasure trove of movie quotes!

cfleming 2018-07-04T02:58:31.000015Z

Although even I get that one.

hagmonk 2018-07-04T02:59:38.000132Z

Out of all the things my brain wants to remember, things like "It's tax day" or "cancel that comcast subscription" are impossible. I can instead recite much of the script of Full Metal Jacket, or SpaceBalls. I wish I knew why!

cfleming 2018-07-04T03:00:03.000098Z

There’s probably a way you can encode useful information using that.

cfleming 2018-07-04T03:00:40.000053Z

Like those walk-through-my-house tricks that people use to remember 100 names in 5 minutes.

hagmonk 2018-07-04T03:03:20.000096Z

Yeah I should try that someday - names! Another thing that totally escapes me. I need a “notional representation” in my head of the person before I can attach a name to them. Before that everyone gets filed under “person”.

hagmonk 2018-07-04T03:03:46.000109Z

I just apologize up front and tell people to prepare to be asked several times

cfleming 2018-07-04T03:04:22.000120Z

I used to think I had a filing problem, then I realised that actually I just never paid attention when people told me their names. Once I started doing that I actually had a fighting chance of remembering some 🙂

hagmonk 2018-07-04T03:05:31.000156Z

Yeah there are tricks around repeating their name, finding a mnemonic - it’s very impressive when someone has mastered doing that to large groups. People do like it when their names are recalled.

cfleming 2018-07-04T03:06:45.000108Z

This repo has some interesting stuff in it: https://github.com/ravichugh/sketch-n-sketch/blob/acafb67256dd59f177b17c4b051eae905ba11987/src/DeuceTools.elm

cfleming 2018-07-04T03:07:51.000074Z

Now this is what I call a function name: https://github.com/ravichugh/sketch-n-sketch/blob/acafb67256dd59f177b17c4b051eae905ba11987/src/CodeMotion.elm#L456

cfleming 2018-07-04T03:09:21.000151Z

They’ve put an impressive amount of work into the refactoring for what is essentially a glorified PoC

hagmonk 2018-07-04T03:12:14.000021Z

Interesting, I haven't actually looked at Elm before

cfleming 2018-07-04T03:12:27.000023Z

It’s like haskell-lite

cfleming 2018-07-04T03:12:51.000132Z

The pattern-matching stuff is really nice for programming tool work (compilers, refactoring tools)

hagmonk 2018-07-04T03:13:34.000068Z

I often find myself wanting core.match to be a little more integrated into clojure for similar reasons

cfleming 2018-07-04T03:14:17.000102Z

I think it works best with static types (ADTs), but that would be nice, yeah.

hagmonk 2018-07-04T03:14:32.000045Z

Last time I used it was in depify https://github.com/hagmonk/depify/blob/master/src/depify/project.clj

hagmonk 2018-07-04T03:15:17.000083Z

I had to break a larger match clause into several functions because it kept blowing the … whatever it is when there's too much code. ETOOMANYBYTECODE

hagmonk 2018-07-04T03:16:01.000043Z

it was probably angry because I was using recur on the rhs of the matches

cfleming 2018-07-04T03:18:32.000019Z

No, I think it just generates a humungous amount of code.

hagmonk 2018-07-04T03:20:42.000020Z

breaking it into separate functions appeased the compiler. so things like that, plus it's a lib, plus it's a macro, I end up using it quite sparingly

hagmonk 2018-07-04T03:21:29.000060Z

maybe we could get partway there if it was possible to use specs in destructuring positions

dpsutton 2018-07-04T03:23:16.000084Z

the scheme macro syntax with its case style is just outstanding

hagmonk 2018-07-04T03:23:52.000098Z

I'd love to see an example!

cfleming 2018-07-04T03:26:27.000092Z


cfleming 2018-07-04T03:26:47.000144Z


(define-syntax while
  (syntax-rules (<keywords>)
    ((<pattern>) <template>)
    ((<pattern>) <template>)))

cfleming 2018-07-04T03:27:12.000060Z

Which might look like:

(define-syntax while
  (syntax-rules ()
    ((while condition body ...)
     (let loop ()
       (if condition
             body ...

cfleming 2018-07-04T03:27:52.000122Z

So it’s a pattern-matching system rather than defmacro

hagmonk 2018-07-04T03:28:31.000127Z

so this relieves us from having to quote and splice?

cfleming 2018-07-04T03:29:09.000009Z

Right. I haven’t used it enough in anger to know whether it does so totally or not.

dpsutton 2018-07-04T03:29:52.000110Z

it seems very natural. and i love the first class pattern matching. but i haven't used it enough in anger. seems tough these days to flush out a real long project in scheme

cfleming 2018-07-04T03:30:02.000065Z

It makes simple macros much easier IMO, but it can’t be used for more complex ones.

cfleming 2018-07-04T03:30:13.000155Z

i.e. something like core.match can’t be expressed as a simple template.

hagmonk 2018-07-04T03:30:45.000013Z

fun fact: there's a scheme interpreter in the macOS and iOS kernels

cfleming 2018-07-04T03:31:05.000149Z

Really? I didn’t know that.

dpsutton 2018-07-04T03:31:32.000079Z

microsoft just recently released a configuration purposed scheme for .NET: https://github.com/Microsoft/schemy

hagmonk 2018-07-04T03:31:50.000099Z

look in /usr/share/sandbox, it's used to express the sandbox restrictions the kernel enforces on various subsystems

cfleming 2018-07-04T03:32:06.000002Z

I think people run up against the limitations of syntax-rules pretty quickly, and then move on to syntax-case, which is way more complex and also (IIRC) turing complete.

dpsutton 2018-07-04T03:32:35.000031Z

ah i've always been confused by the distinction.

cfleming 2018-07-04T03:33:07.000003Z

Syntax-rules is just very simple templates. It’s really nice for basic things but can’t do anything more complex.

cfleming 2018-07-04T03:33:38.000150Z

In syntax-case, you work with syntax objects, which are sort of like Clojure forms with metadata

cfleming 2018-07-04T03:33:58.000102Z


cfleming 2018-07-04T03:35:31.000151Z

And then in Racket you can go to syntax-parse, which is a full grammar-based macro definition like spec on steroids: https://docs.racket-lang.org/syntax/Parsing_Syntax.html

dpsutton 2018-07-04T03:39:44.000109Z

are you a schemer? from college or part time?

cfleming 2018-07-04T03:43:57.000090Z

No, but I’m generally interested in macro systems - I’ve never actually sat down and used Scheme for much beyond some simple dabbling though.

cfleming 2018-07-04T03:44:29.000095Z

I read a lot about all this when writing the macro parsing stuff for Cursive.

dpsutton 2018-07-04T03:52:02.000115Z

wow. have you looked at bronsa's decompiler library about how it tries to reconstitute macros from their expanded forms?

dpsutton 2018-07-04T03:55:39.000043Z

the stuff you've done with static analysis is amazing

cfleming 2018-07-04T03:55:54.000166Z

Yeah, it’s pretty neat. He didn’t think it would be that useful for real-world things though, IIRC it special cases a bunch of things using heuristics for each macro form it tries to decompile.

cfleming 2018-07-04T03:56:07.000131Z

Thanks! It’s a fun project to work on.

cfleming 2018-07-04T03:56:53.000082Z

I spoke about some of this at the conj a couple of years ago: https://www.youtube.com/watch?v=kt4haSH2xcs

cfleming 2018-07-04T03:57:07.000031Z

In case you’re interested.

cfleming 2018-07-04T03:58:08.000084Z

@hagmonk Is that MacOS scheme interpreter available for apps to use? Not that embedding some other one in an app is hard to do I guess.

cfleming 2018-07-04T03:58:29.000103Z

I just looked in /usr/share/sandbox/, that’s pretty wild

hagmonk 2018-07-04T03:59:34.000065Z

owing to the fact the entire reason it's there is to interpret sandbox profiles, I'm pretty sure it's quite locked down ... I haven't actually even thought to check if an API is exposed, lol

hagmonk 2018-07-04T04:00:08.000101Z

I think there's also a plist interpreter in there too. ah, the sacrifices we make

cfleming 2018-07-04T04:00:21.000098Z

Yeah, just embedding whichever Scheme flavour you prefer is probably easier for an app anyway.

dpsutton 2018-07-04T04:01:35.000038Z

do you work at apple @hagmonk?

cfleming 2018-07-04T04:02:22.000049Z

If he told you that, he’d probably have to kill you.

dpsutton 2018-07-04T04:02:43.000119Z

haha my friend works there. it's secretive but it's not that secretive

dpsutton 2018-07-04T04:03:09.000073Z

the biggest worry is probably asking questions about apple and stuff. which i won't do and don't care about

cfleming 2018-07-04T04:03:26.000041Z

The armed drones are in flight and on course to your location as we speak.

hagmonk 2018-07-04T04:05:18.000019Z

I'm not at liberty to discuss the nature of my mission :thinking_face:

dpsutton 2018-07-04T04:05:28.000056Z

fair enough 🙂

dpsutton 2018-07-04T04:05:50.000126Z

i didn't mean to derail anything

hagmonk 2018-07-04T04:06:03.000031Z

I get this question all the time ;)

dpsutton 2018-07-04T04:06:07.000100Z

oh sorry

hagmonk 2018-07-04T04:07:01.000017Z

no no, I'm just joking. People often figure out where I work, I'm not particularly secretive about it

hagmonk 2018-07-04T04:07:28.000022Z

but I've been there for 13 years so this is how I survive ;)

dpsutton 2018-07-04T04:07:56.000032Z

well i won't ask any more questions. i just hope you're at the new campus and not stuck at the old.

dpsutton 2018-07-04T04:08:01.000037Z


cfleming 2018-07-04T04:08:19.000066Z

It’s surprising how many large companies don’t want this sort of thing public though, I’ve had to sign various EULA extensions for companies who don’t want me to identify them as customers, I think because they don’t want anyone knowing the technologies they use.

dpsutton 2018-07-04T04:09:07.000131Z

i've heard google uses Go. keep that down low though

hagmonk 2018-07-04T04:10:54.000118Z

well, the fruit company has unique problems. people stalk social media looking for things engineers are talking about, trying to infer direction, you wouldn't believe the lengths ... some of the downside of being an almost $1T company that has a history of surprising markets

dpsutton 2018-07-04T04:11:36.000188Z

yeah. i hate the rumor stuff. sucks when products/services are introduced and get a yawn because everyone heard already and expects more surprises regardless of how great the actual release is

cfleming 2018-07-04T04:12:28.000106Z

How’s that self-driving car coming along, @hagmonk?

dpsutton 2018-07-04T04:12:47.000006Z

drones are rerouted and will be at your location soon

hagmonk 2018-07-04T04:14:16.000090Z

LOL, I drive myself to work every day, dunno what you're talking about :) plus originally from .au, so I'm in the market for a V8 self-driving car but they're hard to come by …

cfleming 2018-07-04T04:15:17.000056Z

I haven’t heard much about Holden’s self-driving plans.

cfleming 2018-07-04T04:15:33.000143Z

(this is getting dangerously #off-topic)

hagmonk 2018-07-04T04:15:57.000064Z

last I heard they self-drove themselves to an off-shore manufacturing facility

hagmonk 2018-07-04T04:16:12.000158Z

there aren't too many people in the channel ;)

dpsutton 2018-07-04T04:16:30.000041Z

and sean got bored and left. i think we're safe