{"id":16960214,"url":"https://github.com/dflemstr/semantic-editor.old2","last_synced_at":"2025-08-20T12:15:10.470Z","repository":{"id":66855318,"uuid":"103851572","full_name":"dflemstr/semantic-editor.old2","owner":"dflemstr","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-30T15:10:18.000Z","size":422,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T18:08:39.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dflemstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-17T18:21:52.000Z","updated_at":"2021-04-23T09:34:33.000Z","dependencies_parsed_at":"2023-02-21T05:00:41.372Z","dependency_job_id":null,"html_url":"https://github.com/dflemstr/semantic-editor.old2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflemstr%2Fsemantic-editor.old2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflemstr%2Fsemantic-editor.old2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflemstr%2Fsemantic-editor.old2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflemstr%2Fsemantic-editor.old2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflemstr","download_url":"https://codeload.github.com/dflemstr/semantic-editor.old2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487695,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T22:47:34.281Z","updated_at":"2025-04-11T22:10:55.977Z","avatar_url":"https://github.com/dflemstr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `semantic-editor` [![CircleCI](https://circleci.com/gh/dflemstr/semantic-editor.svg?style=svg)](https://circleci.com/gh/dflemstr/semantic-editor)\n\nA versatile editor for different kinds of content.\n\nEdits content *semantically*.  You don't manipulate characters, but rather the structure of your\ncontent.  It is impossible to make syntax errors or break style guides. \n\nThis program is in an early state of development!\n\n## Development\n\nTo develop on `semantic-editor`, you need to install:\n\n  - Rust, it's recommended to follow the instructions at \u003chttps://rustup.rs/\u003e.\n  - The nightly Rust compiler with `wasm32` support.  You probably want to install the specific\n    one specified in the [rust-toolchain](./rust-toolchain) file in this repo, to get build\n    reproducibility:\n\n    ```text\n    rustup toolchain install $(cat rust-toolchain)\n    rustup target add wasm32-unknown-unknown --toolchain $(cat rust-toolchain)\n    ```\n  - node.js, at least version 8.9.4 (\u003chttps://nodejs.org/\u003e)\n  - The `yarn` build tool for node (\u003chttps://yarnpkg.com/\u003e)\n  - `wasm-bindgen` from \u003chttps://github.com/alexcrichton/wasm-bindgen\u003e\n  - `cargo-watch` via `cargo install cargo-watch` (only needed for development)\n\nStarting the application should be as simple as doing `yarn start`.  It probably takes a while to\ncompile everything the first time; wait until everythimg seems to be done then reload your web\nbrowser.\n\n## Architecture\n\nFor now, `semantic-editor` doesn't have a frontend on its own, and must use a web browser to render\nitself.\n\nThe general idea is that the editor runs as a HTTP service, and you can open a view of the editor in\nyour web browser.  Your browser tabs share the same editor state, and can be thought of as \"frames\"\nin an editor like Emacs; if you have a file open in two tabs, any changes made in one tab will\neventually show up in the other.\n\nThe architecture involves these components:\n\n```text\n┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Backend                                                       ┃\n┃ ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐ ┃\n┃ │ semantic-editor │  │ platform native │  │   File system   │ ┃\n┃ │    process      │←→│       tool      │←→│   Network I/O   │ ┃\n┃ │  (rust native)  │  │   (e.g. javac)  │  │  Native Runtime │ ┃\n┃ └─────────┬───────┘  └─────────────────┘  └─────────────────┘ ┃\n┗━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n            │\n        Unreliable\n        connection\n            │\n┏━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n┃ Frontend  │                                                   ┃\n┃ ┌─────────┴───────┐  ┌─────────────────┐  ┌─────────────────┐ ┃\n┃ │ Browser service │  │ semantic-editor │  │Editing interface│ ┃\n┃ │     worker      │←→│     module      │←→│   in browser    │ ┃\n┃ │   (Javascript)  │  │   (rust wasm)   │  │ (TS/React/Redux)│ ┃\n┃ └─────────────────┘  └─────────────────┘  └─────────────────┘ ┃\n┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\n```\n\nThe user creates a new frontend instance by connecting via HTTP to the backend process.  The backend\ntransfers a copy of all of the static files needed to bootstrap the service worker, the\nsemantic-editor WebAssembly module and the editing interface code.  At this point, the frontend and\nbackend communicate via an event/action-based protocol to synchronize state and they are completely\nindependent.\n\nThe backend is responsible for handling interaction with the outside world (invoking compilers,\nreading and writing files, running programs, making commits etc).\n\nThe frontend is independently capable of performing any editor operation such as changing content,\nsearching symbolically, etc.\n\nIf the connection between the backend and the frontend is lost, events are buffered up and will be\nconsolidated when the connection is back up.  This might cause conflicts if the editor state has\nchanged significantly in the meantime.\n\n## Semantics\n\nThe editor edits all content semantically.  That means that it's not possible to edit any general\ntext file; the editor requires support for each specific content format.\n\nFor now, the structure of content is described using Rust `struct`s.  When opening a file, the\ncontents are parsed into a format-specific AST and then manipulated as such, then serialized back\ninto an actual text format upon save.  `semantic-editor` will intentionally not preserve the\nspecific indentation/line breaks/etc of the original file, but rather enforce a global, consistent\nstyle guide for each format.\n\nSince the `semantic-editor` backend is written in Rust, it is possible to use native tools for\ninteracting with content.  `semantic-editor` should not implement its own Java linter/highlighter;\nit should bind to `libjvm` and use the Java compiler directly to perform that task!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflemstr%2Fsemantic-editor.old2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflemstr%2Fsemantic-editor.old2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflemstr%2Fsemantic-editor.old2/lists"}