rokitna
2019-5-16 11:09:54

I think the Markdown creator’s way of seeing it is that the success of Markdown is specifically due to the fact it has no spec.

Once the creator of CommonMark realized there was such a difference of ideology there, I think he asked the Markdown creator if calling the Markdown spec “Common Markdown” would be better, since that made it a specific dialect of its own. The Markdown creator said something like, any specification that looked like it specified the term “markdown” would give people the wrong idea. So the spec creator went with “CommonMark” instead.

When I feel like agreeing with the specless point of view, I’d say Markdown is a natural language that revolves around what looks good in a plain text file. Standardizing Markdown would keep it from advancing together with advancements to the natural language around it.

However, I almost always prefer having a spec. I think implementations of a language ossify it already, and specs ameliorate the ossification by helping users understand which behaviors are likely to change and how to avoid relying on them. Meanwhile, another more abstract source of ossification takes the form of developers’ ignorance that certain features are even needed (e.g. because all the people who need them are marginalized or across a language barrier); a spec can provide developers with information on why those features are needed and how they need to work.


mflatt
2019-5-16 11:26:48

The update is in progress, but it takes a while because it’s a build of all packages form scratch on an old machine.


jaklingonzal
2019-5-16 11:37:15

@jaklingonzal has joined the channel


magnus.an
2019-5-16 12:02:56

@magnus.an has joined the channel


abmclin
2019-5-16 13:19:54

@carl.morris.world it seems that eval would be appropriate for you, if you could post your minimal example, it would be helpful for us to see more closely what you want to do


carl.morris.world
2019-5-16 16:26:36

I just setup an example on GitHub: https://github.com/venuur/minimal-eval-example


carl.morris.world
2019-5-16 16:26:58

I wanted it to be smaller, but I haven’t figured out everything I can trim yet.


carl.morris.world
2019-5-16 16:27:58

It’s a language implemented using #lang br following the tutorials on Beautiful Racket: https://beautifulracket.com/appendix/master-recipe.html


carl.morris.world
2019-5-16 16:29:34

The crux of it is from test-eval.rkt: https://github.com/venuur/minimal-eval-example/blob/master/test-eval.rkt #lang racket (require rackunit) ; What works but requires a file per small test. (check-equal? ((dynamic-require "test-script.rkt" 'gs-program-result)) "123") ; What I would like to work ;(check-equal? ; (with-output-to-string (eval "lang minimal-eval-example" "1 2 3")) ; "123")


carl.morris.world
2019-5-16 16:32:09

And to give credit where it’s due, I’m just implementing Golfscript as an exercise in learning to use Racket: http://golfscript.com/golfscript/


soegaard2
2019-5-16 16:33:53

@carl.morris.world Let’s forget eval for a moment. What would the ideal test expression look like?


carl.morris.world
2019-5-16 16:35:11

Ideally something like (check-equal? (run-with-my-lang "1 2 3") "123")


carl.morris.world
2019-5-16 16:36:11

Then instead of having a separate file test-script.rkt for each snippet I want to eval, I could include it inline in the test module.


soegaard2
2019-5-16 16:37:33

Using eval is definitely one route.


soegaard2
2019-5-16 16:39:04

Another idea: Write a temporary file “test.rkt” with the context of "#:lang golfscript 1 2 3". Then use dynamic-require to run the contents of the file.


carl.morris.world
2019-5-16 16:39:51

Ahh, so write the scripts to temp files as the tests are running


soegaard2
2019-5-16 16:40:10

Maybe eval is better fit here after all.


alexknauth
2019-5-16 16:40:40

Wouldn’t make-module-evaluator fit the same style as the temporary file?


soegaard2
2019-5-16 16:41:01

looks up make-module-evaluator


soegaard2
2019-5-16 16:46:21

I think so - but if eval is used (either directly or with make-module-evaluator) I think, the custom golfscript reader needs to be invoked manually.


alexknauth
2019-5-16 16:47:13

With make-module-evaluator you can pass it a string that has the #lang line at the top, and it will use that lang for the reader


soegaard2
2019-5-16 16:47:26

Fits perfectly then!


carl.morris.world
2019-5-16 16:51:22

that’s so cool! I didn’t know you could pass the lang line in directly.


carl.morris.world
2019-5-16 16:51:31

I just tried it, and it seemed to work.


carl.morris.world
2019-5-16 16:52:52

False alarm, I got an error


carl.morris.world
2019-5-16 16:53:03

```


carl.morris.world
2019-5-16 16:53:12
dynamic-require: name is protected
  name: 'read-syntax
  module: #<resolved-module-path:(submod "C:\Users\carlm\workspace\golfscript\minimal-eval-example\minimal-eval-example\main.rkt" re...

carl.morris.world
2019-5-16 16:53:41

(make-module-evaluator "#lang minimal-eval-example\n1 2 3")


soegaard2
2019-5-16 16:55:05
(make-module-evaluator	 	module-decl
         [	#:language lang
                #:allow-for-require allow-for-require
                #:allow-for-load allow-for-load
                #:allow-read allow-read])

alexknauth
2019-5-16 16:56:59

Does putting a (call-with-trusted-sandbox-configuration (lambda () ...stuff...)) around it help?


carl.morris.world
2019-5-16 16:58:48

It got rid of the error


carl.morris.world
2019-5-16 17:00:02

It worked. (define x (call-with-trusted-sandbox-configuration (λ () (make-module-evaluator "#lang minimal-eval-example\n1 2 3")))) (display (x '(gs-program-result)))


carl.morris.world
2019-5-16 17:00:09

Prints 123 as hoped


carl.morris.world
2019-5-16 17:01:35

Now I can wrap that up in a function to make my test scripts inline.


soegaard2
2019-5-16 17:04:13

On Reddit bjoli has an interesting question on using Chez from Racket. It is possible, but is there already an chez-ffi (similar to the current C ffi), or is that something to look forward to?



carl.morris.world
2019-5-16 17:07:52

Thanks @alexknauth, @soegaard2!


notjack
2019-5-16 17:30:41

That seems sensible


mflatt
2019-5-16 17:35:02

Answered there.


asumu
2019-5-16 17:54:00

Just put up a blog post on modeling WebAssembly in Redex: https://www.asumu.xyz/blog/2019/04/29/webassembly-in-redex/



pocmatos
2019-5-16 17:59:59

^ @asumu post


samth
2019-5-16 19:32:14

aha, it was the instance argument I was missing when I wrote that code