Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e9d3954
Implement a Lisp test suite runner.
Aug 25, 2025
cf98292
Merge branch 'hughbarney:master' into lisp-update
jorge-leon Aug 25, 2025
859bb48
Add two dired tests to the dired test suite, print tests on stdout
Aug 26, 2025
bcc738c
Integrated femto testing in test suite
Aug 27, 2025
5206ff5
Simplify the or macro
Aug 27, 2025
9d6b66c
Fix: add renamed/missing test script
Aug 27, 2025
07d7061
Update string tests to match new function names
Aug 27, 2025
8b1ff55
Add bitwise integer arithmetic
Aug 27, 2025
e4150a9
Extend reader to accept hex notation 0xnn
Aug 27, 2025
3dce275
Extend reader to accept hex notation 0xnn
Aug 27, 2025
be87665
Merge remote-tracking branch 'refs/remotes/origin/lisp-update' into l…
Aug 27, 2025
eeabf50
Fix: remove incorrect comment
Aug 27, 2025
ab1e338
Prepare reader for macro templates.
Aug 27, 2025
3525bf6
Fix: replace deprecated ~ with HOME env var
Aug 28, 2025
f86ca47
Make file.c a "real" fLisp extension
Aug 28, 2025
de28582
Make double extension removable
Aug 28, 2025
1dab404
file extension. add feof, fgets, popen, pclose
Aug 28, 2025
136350a
Fix: build of file extensions needs declared double extension
Aug 28, 2025
146d4a0
Whitespace cleanup, move flisp constants to programming interface sec…
Aug 28, 2025
2b42e35
Add fstat function
Aug 28, 2025
37d5f6d
Replace lisp_eval_string() with lisp_eval() and changed C interface
Aug 29, 2025
5261d80
Fix: fstat does not test on POSIX extended file types, glibc does not…
Aug 29, 2025
e8849e0
Dynamic memory allocation
Aug 29, 2025
706ece7
Fix nthcdr for indexes greater then length of list
Aug 29, 2025
885b8b3
For the moment disable femto.test
Aug 29, 2025
253f684
String test renumbered before femto test
Aug 29, 2025
1d48a64
Remove gc tracing from initRootEnv and lisp_init.
Aug 29, 2025
76a4508
Change fl_debug to not print \n by default
Aug 30, 2025
683e624
Add trace facility for primitives
Aug 30, 2025
1b3c7bd
WIP: implement dynamic memory allocation. lisp_new() doesn't need mem…
Aug 30, 2025
bd70145
WIP: save gcTop in evalCatch
Aug 30, 2025
d297307
Add gcTop tracking feature
Aug 30, 2025
e79796b
Some small reformatting and output improvements
Sep 1, 2025
01448ba
WIP: refactor evalCatch/result reporting
Sep 1, 2025
651d4c5
WIP: evalCatch: create catch object from interp. Result access via C …
Sep 1, 2025
b7176e6
Whitespace cleanup
Sep 1, 2025
9ca6b9e
Fix: flush output before returning.
Sep 1, 2025
e35c6b2
Update ROADMAP for dynamic memory allocation
Sep 2, 2025
54fdc3a
WIP: align result between lisp_eval and evalCatch
Sep 2, 2025
bd53335
Fix: buffer overflow in substring. Simplify.
Sep 2, 2025
5c40a0e
WIP: hunt heisenbug
Sep 2, 2025
c34ba4b
WIP: documentation
Sep 2, 2025
d1cd5a9
Fix: Re-add strdup to substring
Sep 3, 2025
38a7c34
Dynamic memory management survives gc_always
Sep 3, 2025
2a82ba5
Fix: make FLISP_RESULT_* macros take the interpreter as argument
Sep 3, 2025
5347143
Account for size of argv and library_path when allocating memory
Sep 3, 2025
9ec3406
Re-add facility to specify initial memory
Sep 3, 2025
a726812
Update dokumentation
Sep 3, 2025
7720921
Add fungetc, unify fgetc and streamGetc
Sep 5, 2025
fb196d3
Improve on file library, add mkdir, doxygen documentation
Sep 5, 2025
c0a4eb2
Add (minimal) file extension documentation.
Sep 5, 2025
fda6775
Update debian/changelog
Sep 5, 2025
cd75a5c
Fix: alpine security requires format string.
Sep 5, 2025
5c88905
Add some Alpine Linux security flags to compilations
Sep 5, 2025
afa6d01
Fix: compatibilty with non-strict 64bit architectures.
Sep 5, 2025
de8d58b
Merge branch 'debian-latest' of github.com:jorge-leon/femto into debi…
Sep 5, 2025
59539dd
Fix: recompile docs
Sep 5, 2025
1314889
Fix: debian/changelog
Sep 5, 2025
2191e95
Fix: (memq nil list) would not detect a nil in list
Sep 7, 2025
4fba0a2
Rename map1 to mapcar (Elisp). Finish core.lsp documentation
Sep 7, 2025
f4a417d
Fix: update tap.lsp to renamed map1 -> mapcar
Sep 7, 2025
58b8163
Fix append, add apply
Sep 8, 2025
fbe3923
Complete documentation for fLisp functions
Sep 8, 2025
980a65b
file extension: add fttyp
Sep 10, 2025
dede319
Refactor fLisp roadmap
Sep 10, 2025
7c7bb0a
Update fLisp status in README
Sep 10, 2025
2765b82
Add femto ROADMAP, update flisp ROADMAP
Sep 10, 2025
ef58758
Update roadmaps. Update README with more build instructions
Sep 10, 2025
1e0d34e
Remove (invalid) errno reference
Sep 10, 2025
33ab6db
Replace (system) with (fstat) to load user rc file. Add log facility
Sep 10, 2025
f7a40d7
Fix: (open) print error message instead of errno
Sep 10, 2025
e29ffb4
Move (system) from fLisp core to file extension
Sep 10, 2025
99b6fef
Update femto roadmap
Sep 10, 2025
5257dc9
Move os.getenv to file extension and rename to getenv
Sep 10, 2025
33249ce
Fix: os.getenv for batch mode to getenv
Sep 10, 2025
6471f9b
WIP: replace C-repl in flisp with Lisp repl in flisp.rc
Sep 10, 2025
d5f3918
flisp C-code reduced to minimum - rest is done in Lisp
Sep 11, 2025
53c017c
Unified stdlib.lsp into flisp.lsp
Sep 11, 2025
4303bfe
Remove number-to-string, expanded string to cover it more generically
Sep 11, 2025
f1c1c4a
Update documentation.
Sep 11, 2025
1eee634
WIP: replace setq and define with bind
Sep 11, 2025
fb3a500
Update docs and test
Sep 11, 2025
8680d25
Replace some fprintf's with fputs. Unify Stream string serialization
Sep 12, 2025
d99ea82
Add (flisp 'version) command
Sep 12, 2025
5c8c104
Rename (flisp) to (interp) and add (interp 'input)
Sep 12, 2025
5ef013a
Rewrite repl to use (interp 'input), documentation
Sep 12, 2025
583b1ba
Test: split fLisp documentation
Sep 12, 2025
f221af9
Test: split fLisp documentation
Sep 12, 2025
fb1d664
Test: split fLisp documentation
Sep 12, 2025
7a219cf
Fix: tap/Lisp tests
Sep 12, 2025
15be6ce
Doc: split out the editor extension documentation.
Sep 12, 2025
1d6e9cd
Doc: add missing editor.md file
Sep 12, 2025
4ef645f
Update roadmap
Sep 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion BUGS
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
BUGS encountered during fLisp refactoring and batch mode
BUGS encountered since fLisp refactoring and batch mode

funcmap.c:86:22: warning: variable 'count' set but not used [-Wunused-but-set-variable]
86 | int count = 0;
| ^

lisp.c:2690:18: warning: address of stack memory associated with compound literal {type_cons, .car = io_error, .cdr = o} returned [-Wreturn-stack-address]
2690 | return &(Object) { type_cons, .car = io_error, .cdr = o };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


- valgrind detects several memory leaks, call with:
FEMTO_DEBUG=0 valgrind --leak-check=full --track-origins=yes femto
Expand Down
12 changes: 10 additions & 2 deletions README.flisp.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ meant to be very small.
- To be easy to understand without extensive study (to encourage further
experimentation).

Size by version:

Version Binary C-Lines/sloc/Files Lisp-Lines/sloc/Files
0.13 85584 3.6k/2.4k/6 373/272/3

## History

Expand Down Expand Up @@ -88,6 +92,10 @@ In 2025 another set of changes were introduced:
- Numbers are represented by 64 bit integers instead of double floats.
- The Lisp libraries have been extended and functions have been
improved for compatibilty.
- Lisp object space adjusts dynamically when needed.
- setq was replaced by bind
- Enough framework was built to implement the repl completely in Lisp.


## Building

Expand All @@ -99,8 +107,7 @@ fLisp should be buildable with only the standard C libraries.

## Future

- Expand Lisp garbage collected memory as needed.
- Implement the backtick and comma reader macros. See [
- Implement the backtick and comma reader macros. See [5]
- Adapt build system to be able to un/install `flisp` binary. Includes
preparing a Lisp library and a startup file.
- Extend file extension to be usable for Lisp programs.
Expand All @@ -117,3 +124,4 @@ fLisp should be buildable with only the standard C libraries.
- [5] mal - quasiquote https://github.com/kanaka/mal
- [6] Scheme https://www.scheme.org/
- [7] Scheme v7 Standard https://standards.scheme.org/official/r7rs.pdf
- [8] TSPL2d https://www.scheme.com/tspl2d/
114 changes: 73 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Femto comes with Markdown and HTML documentation. To rebuild the
documentation [Pandoc](https://pandoc.org/) is required. Rebuild both
documentation formats from their respective source files by running:

make doc
make doc

The documentation is prebuilt in this repository and can be found in

Expand Down Expand Up @@ -65,11 +65,11 @@ decending order with each further reduction of functionality. The Nano
and Pico Emacs editors have been around for a while.

* Nano means 10 to the power of minus 9
* Pico means 10 to the power of minus 12
* Pico means 10 to the power of minus 12
* Femto means 10 to power of minus 15
* Atto means 10 to power of minus 18
* Zepto means 10 to the power of minus 21
* Zep is smaller version of Zepto Emacs
* Zep is smaller version of Zepto Emacs

In Defining Atto as the lowest functional Emacs I have had to consider
the essential feature set that makes Emacs, 'Emacs'. I have defined
Expand Down Expand Up @@ -114,24 +114,24 @@ For a full version history please refer to the file [CHANGE.LOG.md](./CHANGE.LOG
## Comparisons with Other Emacs Implementations

Femto has almost the same level of functionality as MicroEmacs 3.10
for a codebase about 15% of the size.

Editor Binary BinSize KLOC Files

atto atto 33002 1.9k 10
pEmacs pe 59465 5.7K 16
Esatz-Emacs ee 59050 5.7K 14
femto femto 144008 8.4k/6.0k 24/36 **
GNOME GNOME 55922 9.8k 13
Zile zile 257360 11.7k 48
Mg mg 585313 16.5K 50
uEmacs/Pk em 147546 17.5K 34
Pico pico 438534 24.0k 29
Nano nano 192008 24.8K 17
jove jove 248824 34.7k 94
Qemacs qe 379968 36.9k 59
ue3.10 uemacs 171664 52.4K 16 ++
GNUEmacs emacs 14632920 358.0k 186
for a codebase less then half of the size.

Editor Binary BinSize KLOC Files

atto atto 33002 1.9k 10
pEmacs pe 59465 5.7K 16
Esatz-Emacs ee 59050 5.7K 14
femto femto 162392 10.8k/7.6k 25/37 **
GNOME GNOME 55922 9.8k 13
Zile zile 257360 11.7k 48
Mg mg 585313 16.5K 50
uEmacs/Pk em 147546 17.5K 34
Pico pico 438534 24.0k 29
Nano nano 192008 24.8K 17
jove jove 248824 34.7k 94
Qemacs qe 379968 36.9k 59
ue3.10 uemacs 171664 52.4K 16 ++
GNUEmacs emacs 14632920 358.0k 186

Since femto 2.12 C code has been moved out to Lisp. The first number
in the KLOC column is the line count, the second the sloccount. The
Expand All @@ -140,31 +140,34 @@ includes the required Lisp files.

## Building

### Build and Installation
### Build Debendencies

These instructions should work with most versions of linux
Debian and Ubuntu:

$ cd $HOME
$ mkdir -p ~/src
$ git clone https://github.com/hughbarney/femto.git
$ cd femto
$ sudo make install
Before ncurses 6 and as of Femto 1.2 you will need to install the
libcurses dev package.

### Building on Ubuntu (using UTF8 support in ncurses / ncursesw)
$ sudo apt-get install libncurses5-dev libncursesw5-dev

When building on Ubuntu you will need to install the libcurses dev package.
NOTE: As of Femto 1.2 you will also need the libncursesw (wide) library
Since ncurses 6:

$ sudo apt-get install apt-file
$ apt-file update
$ sudo apt-get install ncurses-dev

now search for which package would have curses.h
Alpine Linux:

$ apt-file search curses.h
$ sudo apk add ncurses-dev

libncurses5-dev: /usr/include/curses.h
FreeBSD:

$ sudo apt-get install libncurses5-dev libncursesw5-dev
$ sudo pkg install devel/ncurses

### Build, Test and Installation

$ git clone https://github.com/hughbarney/femto.git
$ cd femto
$ make femto
$ make test
$ sudo make install


## Future Enhancements
Expand All @@ -173,8 +176,6 @@ The following enhancements are envisaged.

* Directory and file manegement (Dired) functionality. A basic start has been made with dired.lsp

* Ability to configure the syntax highlighter for python

* Ability to load a file in read-only-mode

* Ability to setup themes of colors that can be applied to different buffers
Expand All @@ -183,9 +184,40 @@ The following enhancements are envisaged.
* Pipe a buffer through a shell command and read the output back into a different buffer


## Coding Style
## Development

See the [coding style](./style.md) guide.

Pandoc is required for doc generation.
- Debian/Ubuntu: `sudo apt-get install pandoc`
- Alpine: `sudo apk add pandoc-cli`
- NetBSD: `sudo pkgin install pandoc-cli`
- FreeBSD: `pkg install hs-pandoc`

There is a Doxyfile to create full cross references and call graphs.

Usefull build targets:

- femto: build femto binary
- flisp: build fLisp binary
- doc: build some markdown files from Poshdoc and some html files from markdown
- doxygen: build the Doxygen source code documentation
- measure: count # of files and code lines
- test: run unit tests in summary mode
- check: run unit tests and return success if none fails
- ftest: call femto several times with different commandline parameters.
- val: run femto with valgrind. Logs are found in val.log
- clean: clean up build artifacts
- deb: build Debian package
- install/uninstall: install/uninstall locally

Make sure to run:

make clean test
make clean ftest
make clean doc

See [STYLE.MD](./style.md)
before commiting code to Github.


## Copying
Expand Down
13 changes: 10 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
femto (2.24.1-1) bookworm; urgency=medium

* Dynamic memory allocation for Lisp object space.
* Lisp test suite.
* Improved file extension.
-- Georg Lehner <jorge@magma-soft.at> Fri, 05 Sep 2025 15:30:31 +0200

femto (2.23.1-1) bookworm; urgency=medium

* Improved syntax highlighter: C, Lisp and text mode
* File read hook
* Improved syntax highlighter: C, Lisp and text mode
* File read hook
-- Georg Lehner <jorge@magma-soft.at> Thu, 07 Aug 2025 13:05:41 +0200

femto (2.22.1-1) bookworm; urgency=medium

* Minor bug fixes and documentation updates. Upstream version bump.
* Minor bug fixes and documentation updates. Upstream version bump.
-- Georg Lehner <jorge@magma-soft.at> Tue, 05 Aug 2025 15:17:33 +0100

femto (2.21.7-1) bookworm; urgency=medium
Expand Down
Loading