-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Description
From the inception of this language, when I initially presented a basic demo, a significant portion of the demo was dedicated to justifying our decision to develop our own domain-specific language (DSL). While I won't delve into those details at this moment, the extended explanation was because language development shouldn't be taken lightly. But since we're commit to this endeavor, the language should fulfill the following objectives:
- Kick butt
- Establish distinct boundaries to aid us in trimming its scope
- Cater well to our users, that is folks who might not have programmed before
Here are some ideas for your consideration.
- App will have a default directory, When users
create a new projectit will add a new folder to this directory with its name and create the structure of the project (project.toml withname = <name>, some folders including acomponentsfolder andcomponents/main.pf) - A project will just be a directory, but the
project.tomlwill be what defines a project. - The app will search the default directory for all
project.tomls and grab the project's name and display a list of those projects in the app's home screen for the user to select from - Of course users can still open a file browser to select a project/repo that's not in their default directory.
project.tomlwill function much the same as apackage.jsonorcargo.toml, listing dependencies, and any other metadata about the project.- Lang will change from having the
showfunction to exports/public entities. I think this is a better pattern for defining what 3d artifacts are displayed in the scene, and separately supports building utils/modules in separate files. - In general, we'll aim for, convention over configuration. Want to make all projects feel familiar as will help foster an ecosystem.
- The lang will support special comments for documentation, both of Rust
s///for documenting specific things and//!` should be borrowed. - We can also borrow Go's convention of function names prefixed with
exampleto become examples for the suffix (exampleSomeFnis an example forsomeFn) - It would be good for our documentation to have syntax for putting screenshots into the docs (possibly with annotations) This is a departure from other languages' docs system, but reflects the visual nature of the lang

- Reserved folder names, so far I can think of three,
examples,componentsandlib
- examples: (self-explanatory, become examples in the docs)
- components: each file in the folder is expected to export 3d entities (not functions, data or other). When a user selects one of these files they will execute and display in the 3d-scene.
componentsis probably not the best name, the name needs to be fairly generic as needs to cover piece-parts and assemblies. any suggestions?. options:Elements,Structures,Units,Constructs,Modules - lib: just a place for general utils and abstractions that might be used by multiple components. When a user selects one of these, the editor won't change.
project.tomlwill be treated as the central file that defines the project. When the user selects it the right-hand pane (usually the 3d-scene) will instead render the documentation for the project.parts/main.pfwill be a special name that we'd expect to normally be the assembly for an entire project.//!comments at the start of this file form the start of the documentation when the user selects theproject.toml.
- In the short term
project.tomlcan list dependencies as file paths, URLs and git-urls. While a centralised package repository would be nice at some point, allowing the above gives a lot of bang for buck when it comes to having some dependencies support and suits our "local first" approach. - Opinionated formatting: this is already the case since it had to be built for the recasting ability. At some point, we might want to allow some preferences here, but for now, keeping it strict is less of a maintenance burden.
- Dev tools: Big big topic especially since the code-gen that makes up the core of this app is arguably a dev tool. I'll link to Bret Victor's Learnable Programming that @franknoirot found as there's lots there to learn from.
- Walk through onboarding, Getting set up with our mouse preferences etc, as well as walking through how to make their first part.
Needs more consideration
- Errors, how we expose them to user's and how we can best help users resolve them.
Further in the future
- built-in testing framework
- types
- Plugin system, for example, I don't particularly want to build git support, but maybe someone else can.
not doing
- no async, or concurrency support
- no running processes. i.e. no puffin servers.
- I don't think either of the above belongs as capability in the lang, we should stay focused on the use case of script executes to output an artifact.
- No HTTP, I can see us budging on this, but to begin within at least we shouldn't support it. If data needs to be fetched, it should be done beforehand by some other lang/process and left in a csv/json or something to be imported by our lang.
- Exploding scope by supporting other langugaes: Many of the limitations we decide to put on the language will have an easy workaround if executing scripts from other langs is supported.
franknoirot
Metadata
Metadata
Assignees
Labels
No labels