Title: Compiler CLI and Scalability · Issue #131 · racketscript/racketscript · GitHub
Open Graph Title: Compiler CLI and Scalability · Issue #131 · racketscript/racketscript
X Title: Compiler CLI and Scalability · Issue #131 · racketscript/racketscript
Description: This document proposes to replace/(enhance) the racks tool currently used to compile RacketScript programs. Motivation racks is slow It compiles each file serially, which is particularly frustrating during first compilation. We did some ...
Open Graph Description: This document proposes to replace/(enhance) the racks tool currently used to compile RacketScript programs. Motivation racks is slow It compiles each file serially, which is particularly frustratin...
X Description: This document proposes to replace/(enhance) the racks tool currently used to compile RacketScript programs. Motivation racks is slow It compiles each file serially, which is particularly frustratin...
Opengraph URL: https://github.com/racketscript/racketscript/issues/131
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compiler CLI and Scalability","articleBody":"This document proposes to replace/(enhance) the `racks` tool currently used to compile RacketScript programs.\r\n\r\n## Motivation\r\n\r\n### `racks` is slow\r\n\r\n- It compiles each file serially, which is particularly frustrating during first compilation.\r\n- We did some work to avoid recompiling unchanged modules, but it still not foolproof and may require full recompile under certain circumstances. Eg. If a module with macro changes, any other module using that macro must be recompiled.\r\n- The identifier graph used to follow the bindings is recomputed in each run, which takes noticeable number of seconds. This graph can potentially be cached, and only affected modules should be processed to update this graph.\r\n \r\n### `racks` is impractical\r\n\r\nIt simply compiles what it gets. It has no notion of `package.json`, `info.rkt` which is often used in practical applications. It overwrites `package.json` with the default one.\r\n\r\nSome common examples:\r\n\r\n- User can't specify JS dependencies at all.\r\n- No control over how to produce the distribution JavaScript file, and limited to what we allow to use e.g. Gulp, Babel, Minifiers ...\r\n- Plain JavaScript files has to be copied manually to distribution directory.\r\n \r\n## Proposal\r\n\r\n`racks` should be replaced with a tool that more or less is like what `raco` is to Racket or `lein` is to ClojureScript. Here's a rough workflow I see:\r\n\r\n\r\n- Create a new project:\r\n\r\n\t\tracks init my-new-project\r\n\r\n- Install all dependencies:\r\n\r\n\t\tracks install\r\n\r\n- Create a new project using some a template project structure. However, unlike current situation, this is used just to create project. The config can be edited to whatever.\r\n\r\n\t\tracks init my-new-project -t babel-webpack\r\n\r\n- Builds the project:\r\n\r\n\t\tracks build\r\n\r\n- Watch the project and build automatically:\r\n\r\n\t\tracks build --watch\r\n\t\t\r\n- Start a REPL\r\n\r\n\t\tracks repl\r\n\r\n\r\nAll these command could be simple `raco` extensions, like `raco racketscript \u003csubcommand\u003e`, and `racks` can just be alias for `raco racketscript` or something like that.\r\n\r\nSecondly, compilation of each module should be independent of other module as much as possible. There is only much we can do here as mentioned earlier, but there is still scope.\r\n\r\n`info.rkt` can act as combined project configuration, i.e. for both Racket and JavaScript. Since, `package.json` is simply a JSON, it can just be a S-expression in `info.rkt`. The project config can also specify the main entry point, any additional JavaScript/static files that needs to copied, or pretty much anything user may want to do pre/post operations.\r\n\r\n\r\n## Conclusion\r\n\r\nThe documents proposes much more than what we have currently have time and resources for. However I believe it is certainly something we should start thinking about. I will keep on updating this document based on later discussions.\r\n\r\nThis shouldn't require any changes to existing compiler or runtime, and can be built as a new script. So, while we slowly work on it, it shouldn't block us with any other tasks in hand.\r\n","author":{"url":"https://github.com/vishesh","@type":"Person","name":"vishesh"},"datePublished":"2017-09-12T07:25:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/131/racketscript/issues/131"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c628f747-2ab1-2e65-f0b6-4becb101d1b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E768:1587BA:711A34D:946FA4D:696DBB47 |
| html-safe-nonce | 9306bf1d63ec300d25d5de7c27d0a506699a0e12d62c60482f4cf841263517a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzY4OjE1ODdCQTo3MTFBMzREOjk0NkZBNEQ6Njk2REJCNDciLCJ2aXNpdG9yX2lkIjoiNzg0Nzc4ODczMDYyODU1MzU0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e1d57956658ad258b15086e223393b4b812fac74005d9cc1e37ab5a37637069a |
| hovercard-subject-tag | issue:256943456 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/racketscript/racketscript/131/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e678a1f1a90270ca81909ad9304ce623e5df1741d9dff8a778ba6d35f16052ab/racketscript/racketscript/issues/131 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e678a1f1a90270ca81909ad9304ce623e5df1741d9dff8a778ba6d35f16052ab/racketscript/racketscript/issues/131 |
| og:image:alt | This document proposes to replace/(enhance) the racks tool currently used to compile RacketScript programs. Motivation racks is slow It compiles each file serially, which is particularly frustratin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vishesh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| go-import | github.com/racketscript/racketscript git https://github.com/racketscript/racketscript.git |
| octolytics-dimension-user_id | 42381398 |
| octolytics-dimension-user_login | racketscript |
| octolytics-dimension-repository_id | 52491211 |
| octolytics-dimension-repository_nwo | racketscript/racketscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 52491211 |
| octolytics-dimension-repository_network_root_nwo | racketscript/racketscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width