[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 978d8290a1 067/323: Add guide on adding new l
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 978d8290a1 067/323: Add guide on adding new languages |
Date: |
Thu, 9 Mar 2023 10:58:17 -0500 (EST) |
branch: externals/beardbolt
commit 978d8290a1fa17a4586af2a56d720d9211a85173
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Add guide on adding new languages
---
README.org | 29 +++++++++++++++++++++++++++--
rmsbolt.el | 2 ++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/README.org b/README.org
index dc1d4ee8a3..8559c842e3 100644
--- a/README.org
+++ b/README.org
@@ -17,8 +17,9 @@ versa.
would normally.
- Use any libraries on your machine trivially
- Runs entirely without node, npm, or js.
- - No dependencies other than emacs 25 and your compiler ~:)~
- - Code is actually readable
+ - No required dependencies other than emacs 25 and your compiler ~:)~
+ - It's easy to add new languages (even those that use unique bytecode
formats)
+ without touching many files.
- Full undo (tree) system from Emacs on disassembly for easy comparisons
- Infinitely hackable!
@@ -79,3 +80,27 @@ otherwise only top level code will be shown. Python 2 is
unsupported.
No support for source->asm matching or filtering.
[[https://s25.postimg.cc/uhk02ugfz/1_FB9k7.gif]]
+
+* Adding a Language
+
+Adding support for a new language is fairly easy. The closer it is to existing
+compilers, the easier it will be. However, it is not excessively hard to add
+support for completely foreign compilers and bytecode/assembly formats.
+
+As a minimum starting point, you must know how to compile a source file to
+assembly or bytecode on the command line, and know how the line numbers are
+available in the compiled form if they exist.
+
+1. [[file:rmsbolt.el::;;;;%20Language%20Definitions][Add a new entry to the
language definitions statement.]]
+ - To do this, you will need to (at a minimum) add a mode, compile-command, a
+ compile-cmd-function, and a starter file name.
+ - The compile-cmd-function is a function that will turn local variable
+ settings into a valid command which will take in a filename and output
+ assembly or an executable. See ~rmsbolt--c-compile-cmd~ for an example.
+ - If the assembly is not in a standard format, you will need to define a
+ ~process-asm-custom-fn~ as well.
+2. [[file:rmsbolt.el::;;;;;%20Starter%20Definitions][Add a new entry into the
starter file]]
+ - For this, you will need to make a starter file. See
[[file:starters/][this folder]] for
+ existing examples.
+
+You're done!
diff --git a/rmsbolt.el b/rmsbolt.el
index 2a3ce2e497..35b0a404d1 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -930,6 +930,8 @@ Outputs assembly file if ASM."
(save-buffer))
(unless rmsbolt-mode
(rmsbolt-mode 1)))))
+
+;;;;; Starter Definitions
(defmacro rmsbolt-defstarter (lang mode)
"Defines a starter for LANG and MODE."
`(defun ,(intern (concat "rmsbolt-" lang)) ()
- [elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays., (continued)
- [elpa] externals/beardbolt 5deed3972e 276/323: * beardbolt.el (bb--reachable-p, bb--process-asm): Use obarrays., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 291f82a324 266/323: Continue rewriting, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a13f8fe7f4 287/323: Reset beardbolt-specific locals before hacking them in, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 85d24d69f1 286/323: Add bb-kill-symbol-re option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 10fe7307c3 291/323: Get a better C++ starter example, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5324775417 321/323: Add beardbolt-shuffle-rainbow option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 90b5cad9c1 016/323: Finish initial implementation of dissasembly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt de183bea12 010/323: Add support for c++ and c, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 627dd4c1c9 059/323: Allow for custom asm processing functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 978d8290a1 067/323: Add guide on adding new languages,
ELPA Syncer <=
- [elpa] externals/beardbolt f911321a02 058/323: Add support for automatically hot recompiling, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 86742e7b76 055/323: Merge branch 'master' of gitlab.com:jgkamat/rmsbolt, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 01f7664eda 060/323: Fix tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 36b701d70e 072/323: Fix broken tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8d992d1da7 103/323: Add links to README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a74d54e764 109/323: Fix tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 859722f7e0 084/323: Add back support for Emacs 25, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2eca2d59dd 100/323: Merge branch 'patch-2' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a85b457e81 108/323: Fix typo, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt fb0e8c85a3 110/323: Use https links to avoid mixed content warnings, ELPA Syncer, 2023/03/09