Commit Graph

23 Commits

Author SHA1 Message Date
Kartik Agaram 4a943d4ed3 5001 - drop the :(scenario) DSL
I've been saying for a while[1][2][3] that adding extra abstractions makes
things harder for newcomers, and adding new notations doubly so. And then
I notice this DSL in my own backyard. Makes me feel like a hypocrite.

[1] https://news.ycombinator.com/item?id=13565743#13570092
[2] https://lobste.rs/s/to8wpr/configuration_files_are_canary_warning
[3] https://lobste.rs/s/mdmcdi/little_languages_by_jon_bentley_1986#c_3miuf2

The implementation of the DSL was also highly hacky:

a) It was happening in the tangle/ tool, but was utterly unrelated to tangling
layers.

b) There were several persnickety constraints on the different kinds of
lines and the specific order they were expected in. I kept finding bugs
where the translator would silently do the wrong thing. Or the error messages
sucked, and readers may be stuck looking at the generated code to figure
out what happened. Fixing error messages would require a lot more code,
which is one of my arguments against DSLs in the first place: they may
be easy to implement, but they're hard to design to go with the grain of
the underlying platform. They require lots of iteration. Is that effort
worth prioritizing in this project?

On the other hand, the DSL did make at least some readers' life easier,
the ones who weren't immediately put off by having to learn a strange syntax.
There were fewer quotes to parse, fewer backslash escapes.

Anyway, since there are also people who dislike having to put up with strange
syntaxes, we'll call that consideration a wash and tear this DSL out.

---

This commit was sheer drudgery. Hopefully it won't need to be redone with
a new DSL because I grow sick of backslashes.
2019-03-12 19:14:12 -07:00
Kartik Agaram c442a5ad80 4987 - support `browse_trace` tool in SubX
I've extracted it into a separate binary, independent of my Mu prototype.

I also cleaned up my tracing layer to be a little nicer. Major improvements:

- Realized that incremental tracing really ought to be the default.
  And to minimize printing traces to screen.

- Finally figured out how to combine layers and call stack frames in a
  single dimension of depth. The answer: optimize for the experience of
  `browse_trace`. Instructions occupy a range of depths based on their call
  stack frame, and minor details of an instruction lie one level deeper
  in each case.

Other than that, I spent some time adjusting levels everywhere to make
`browse_trace` useful.
2019-02-25 01:50:53 -08:00
Kartik Agaram f5ee2463d0 4264
Undo the relayout of 4259.
2018-06-17 16:23:14 -07:00
Kartik Agaram 5859d7056c 4259 2018-06-16 09:25:47 -07:00
Kartik K. Agaram cd11138824 4210 - a better error
Thanks Ella Couch.
2018-02-20 01:11:22 -08:00
Kartik K. Agaram 2a81a54726 4148 2017-12-07 13:45:01 -08:00
Kartik K. Agaram 8050782c17 4136 2017-12-04 00:08:02 -08:00
Kartik K. Agaram f64f1ca50e 4125 2017-11-19 02:36:35 -08:00
Kartik K. Agaram a89c1bed26 4104
Stop hardcoding Max_depth everywhere; we had a default value for a
reason but then we forgot all about it.
2017-11-03 01:50:46 -07:00
Kartik K. Agaram aae198a93b 4099
Generalize commit 4089 to arbitrary closures, and not just the current
'space' or call frame. Now we should be treating spaces just like any
other data structure, and reclaiming all addresses inside them when we
need to.

The cost: all spaces must now specify what recipe generated them (so
they know how to interpret the array of locations) using the /names
property.

We can probably make this ergonomic with a little 'type inference'. But
at least things are safe now.
2017-11-01 02:46:41 -07:00
Kartik K. Agaram 6424e19999 3898
There seems to be some chance of speed-up when I inline these functions.
However, it's not a clear enough signal to justify improving the `build`
script to handle the `inline` keyword.

Current timing experiments:
              Before                                After
ubuntu 1GB    9:22,8:48,8:51,9:16,9:17,8:36,9:05    8:55,8:41,8:15,8:27,8:29,8:54,9:29
OS X 8GB      4:05,4:00,4:18,4:09,3:40,3:51,3:56    3:58,3:52,4:01,4:13,4:16,4:31,4:13
2017-05-31 16:43:05 -07:00
Kartik K. Agaram f1c8df7dd0 3889 - profile refcount updates by recipe
We're currently spending 50% of our time in `mu edit` performing refcount
updates.
2017-05-29 00:02:59 -07:00
Kartik K. Agaram b2f699e14f 3888 - beginnings of a profiler
Time to make my ad hoc commented out code fragments a first-class feature.
2017-05-28 23:57:19 -07:00
Kartik K. Agaram 5987486862 3887 - clean up early exits in interpreter loop
It's always confusing when `break` refers to a `switch` but `continue`
refers to the loop around the `switch`. But we've done ugly things like
this and `goto` for expedience. However, we're starting to run into cases
where we now need to insert code at every `continue` or `continue`-mimicking
`goto` inside the core interpreter loop. Better to make the loop single-entry-single-exit.
Common things to run after every instruction will now happen inside the
`finish_instruction` function rather than at the `finish_instruction` label.
2017-05-28 23:00:47 -07:00
Kartik K. Agaram 2b25071710 3877 2017-05-26 17:36:16 -07:00
Kartik K. Agaram 2b37bbeae2 3809 2017-04-04 00:10:47 -07:00
Kartik K. Agaram 317c0a34e8 3803 2017-03-20 16:53:36 -07:00
Kartik K. Agaram 192d59d3bb 3380
One more place we were missing expanding type abbreviations: inside
container definitions.
2016-09-17 00:43:20 -07:00
Kartik K. Agaram 58a08ed3e7 3358 2016-09-15 11:22:36 -07:00
Kartik K. Agaram d41955c108 3279
Stop inlining functions because that will complicate separate
compilation. It also simplifies the code without impacting performance.
2016-08-29 14:58:16 -07:00
Kartik K. Agaram 8d72e56521 3120
Always show instruction before any transforms in error messages.

This is likely going to make some errors unclear because they *need* to
show the original instruction. But if we don't have tests for those
situations did they ever really work?
2016-07-21 19:22:03 -07:00
Stephen Malina d8c6265df6 3105
Add number-of-instructions recipe to Mu
2016-07-06 18:59:34 -07:00
Kartik K. Agaram c9a5a7bada 2862
Layers 0-29 are now a complete rudimentary platform except for pointers
and indirection.
2016-04-24 00:35:50 -07:00