Commit Graph

106 Commits

Author SHA1 Message Date
Vincent Ollivier 3b519377c7
Fix panic on commands containing only spaces (#442)
* Fix panic on commands containing only spaces

* Add trim
2022-11-30 23:26:55 +01:00
Vincent Ollivier 6a75ff23a1
Fix panic in chess move parser (#446) 2022-11-30 23:26:35 +01:00
Vincent Ollivier 3be0a0c9a5
Add path to prompt (#444)
* Add path to prompt

* Change tilde position in font

* Update moros.png
2022-11-28 23:21:05 +01:00
Vincent Ollivier b51b060ec1
Add size unit options to commands (#434)
* Add SizeUnit

* Add -b option to list

* Add -b option to disk usage

* Add -b option to memory usage

* Align size to the right

* Update net command

* Add decimal units
2022-11-11 10:41:29 +01:00
Vincent Ollivier d0c8e161e7 Add comment 2022-11-10 09:26:26 +01:00
Vincent Ollivier 39fe99216f
Run clippy (#438) 2022-11-09 23:29:56 +01:00
Vincent Ollivier 23d622176c
Use git describe to display version (#437)
* Use git describe to print version at boot

* Add version command
2022-11-09 09:29:06 +01:00
Vincent Ollivier 8103d8e936
Fix editor delete (#429) 2022-11-01 18:22:00 +01:00
Vincent Ollivier ab9b488a49
Update lisp doc and examples (#428)
* Update documentation

* Add macro?

* Rewrite and and or with macros

* Move string-join

* Update built-in autocompletion

* Use define instead of def in core and examples

* Add changelog to doc

* Move aliases to lib

* Add let macro

* Add caar cadr cdar cddr functions

* Add fixme

* Fix let macro
2022-11-01 11:02:50 +01:00
Vincent Ollivier 0037e24961
Add macro to Lisp (#425)
* Add expand to lisp

* Update tests

* Add quasiquote and unquote

* Rename Lambda into Function

* Add macro

* Fix function_env

* Dry code

* Add define-macro shortcut

* Add mac shortcut

* Refactor inner env

* Move expand to a module

* Add unquote-splicing

* Fix test

* Refactor tests

* Add function args symbol

* Fix typo

* Remove old append

* Add dotted pair

* Revert "Add dotted pair"

This reverts commit 10544b56d8.
2022-10-28 18:43:22 +02:00
Vincent Ollivier f7f1bd85f1
Run clippy (#424) 2022-10-28 09:56:04 +02:00
Vincent Ollivier 0a29f533b2
Add TCO to Lisp (#420)
* Add TCO to Lisp

* Add sum.lsp

* Fix tests

* Refactor code

* Run clippy

* Use tmp var

* Refactor tmp

* Replace Lambda Rc by Box Lambda

* Remove exp clone

* Run clippy

* Remove another exp clone

* Reorder matches

* Remove another clone

* Run clippy

* Remove to_vec

* Add comments
2022-10-24 10:44:17 +02:00
Vincent Ollivier fcf3a7e72f
Add if and while to Lisp (#418)
* Change Lisp loop into while

* Rename define to def

* Replace cond by if

* Fix pi computation

* Fix number parsing error

* Fix or function

* Add test to while

* Rewrite test

* Add missing fun

* Add examples to doc
2022-10-21 10:10:14 +02:00
Vincent Ollivier 1717fe03db
Refactor Lisp (#417)
* Split lisp code

* Move macros

* Reorganize imports

* Move lisp completer

* Fix newlines
2022-10-18 09:26:16 +02:00
Vincent Ollivier 892b697bd3
Add BigInt support to Lisp (#415)
* Add bigint support to Lisp

* Remove Box

* Replace BigInt by i64

* Add back big int

* Work around big int errors

* Print floats with a dot

* Add conversion to f64

* Use Number#parse instead of double

* Add trigo functions to Number

* Add conversion from number to byte

* Add addition to Number

* Add multiplication to Number

* Add negation and substraction to Number

* Add division to Number

* Add reminder to Number

* Add pow to Number

* Fix tests

* Re-enable BigInt

* Add parsing and printing of BigInt

* Add sign

* Add operations on BigInt

* Fix compilation issues

* Add support for add and mul overflow

* Fix bigint conversion to and from str

* Add number-type function

* Add tests

* Add support for pow overflow

* Fix tests

* Add more checks for overflow

* Add check for division by zero

* Fix typo

* Return inf for large exponential operations

* Check for division by zero in modulo

* Add shift operations

* Rewrite comparisons

* Add lazy eval to cond expressions

* Add set fonction

* Add loop function

* Add pi example

* Add builtin pi example to shell

* Update allocation error messages

* Rewrite number conversions

* Remove debug output from pi example

* Move pi command to a dedicated file

* Rewrite bytes->number and number->bytes

* Update doc

* Move op impl to Number

* Add macros to dry code

* Add more macros

* Run clippy
2022-10-17 20:58:08 +02:00
Vincent Ollivier ec57ff1540
Extend and refactor Lisp implementation (#412)
* Adopt a syntax closer to scheme

* Add parse and eval

* Replace Exp::Func with Exp::Primitive

* Refactor built in autocompletion

* Replace null by nil

* Fix test

* Update doc

* Bump version
2022-09-20 19:57:55 +02:00
Vincent Ollivier 1bafa2271c
Add apply to Lisp (#410)
* Replace mapcar by apply

* Add map and reduce to core lib

* Add pi.lsp example

* Fix tests

* Refactor pi-digits

* Move builtin join to core lib as string-join

* Rename decode-* and encode-* to *-decode and *-encode

* Update doc
2022-09-15 20:50:23 +02:00
Vincent Ollivier 5109608ea3
Add Conway's Game of Life (#409)
* Add the Game of Life

* Add seed interval

* Add option to load seed from file

* Add speed option

* Add a status bar at the bottom of the screen

* Refactor rules computation

* Refactor printing

* Add life to autocomplete list

* Fix autocomplete size

* Refactor file loading

* Add centinal.cells

* Add more cells files

* Add ^C to text editor

* Remove -f option

* Remove two patterns

* Remove extra newlines

* Remove code for comments

* Center cells
2022-09-10 10:57:55 +02:00
Vincent Ollivier 1f54cd5e2f
Improve shell (#405)
* Improve whitespace support in shell

* Add glob variable expansion

* Add panic command

* Add USER env var
2022-09-08 09:43:57 +02:00
Vincent Ollivier 7e3c0da53c
Add support for closing connections in request to HTTP server (#406)
* Parse request header

* Add Request#is_persistent

* Close connection when requested
2022-09-04 15:38:10 +02:00
Vincent Ollivier 55531b9e3d
Improve Lisp forms (#402)
* Use x and y variables instead of a and b

* Rewrite not form

* Move boolean forms to core lib

* Handle special arithmetic cases

* Add range form

* Add pr and prn for print and println

* Add more tests to cond
2022-09-03 15:27:52 +02:00
Vincent Ollivier e1be97167e
Add RTC device file (#400)
* Add RTC device file

* Add support for updating the RTC

* Handle 12 hour format

* Check date time

* Add device size
2022-08-28 18:38:48 +02:00
Vincent Ollivier d5c0002f6d
Update shell redirections (#399)
* Update shell redirections

* Allow file truncation during redirection

* Print time output to stderr
2022-08-28 17:26:38 +02:00
Vincent Ollivier 5d0451e379
Improve http timeout (#397) 2022-08-28 17:26:13 +02:00
Vincent Ollivier 0724b5a07b
Move /ini/lisp to /lib/lisp (#398) 2022-08-27 13:07:32 +02:00
Vincent Ollivier 7f3baa2c60
Switch HTTP server to HTTP 1.1 (#395)
* Switch to connection keep-alive

* Upgrade to HTTP 1.1

* Add pcap to makefile
2022-08-27 12:36:20 +02:00
Vincent Ollivier b11f0aeb96
Add new forms to lisp (#385)
* Add decode-float and encode-float forms

* Add uptime form

* Add write-bytes form

* Add list form

* Add new forms to move print to core lib

* Rename file io forms

* Update doc

* Merge cat into string

* Rename *code-float to *code-number

* Add write-file and append-file forms

* Add doc about the core library

* Add regex-find

* Add not

* Add regex-match

* Update doc

* Bump lisp version

* Add realtime

* Update doc
2022-08-25 08:48:19 +02:00
Vincent Ollivier f1a19e2055
Improve HTTP server (#391)
* Link host 8080 port to qemu 80

* Add root dir

* Add support for images

* Add Response struct

* Refactor response buffer creation

* Add index file support

* Copy www dir

* Update trailing slash rule

* Add command line arguments

* Remove strftime function

* Add read only mode

* Implement Display

* Add colored output

* Add Request struct

* Add common date time format

* Add time::now_utc

* Add connexions pool

* Reduce wait time

* Add install --yes

* Fix typo

* Add more mime types
2022-08-25 08:42:35 +02:00
Vincent Ollivier 6397faec44
Update users file (#389)
* Rename passwords.csv to users.csv

* Allow login with empty password
2022-08-17 17:41:56 +02:00
Vincent Ollivier e0596f9f77
Add file append (#387)
* Add file append

* Fix off by one error

* Use append in reopen for shell redirections

* Add documentation

* Update tests
2022-08-14 01:12:52 +02:00
Vincent Ollivier 78756bb94e
Add Brautigan poem (#373) 2022-08-01 21:28:28 +02:00
Vincent Ollivier c341aef9be
Fix variables expansion (#370)
* Add status env var

* Add variable_expansion function

* Add special case for status shortcut

* Remove debug

* Add test
2022-07-17 15:39:38 +02:00
Vincent Ollivier 79682d2302
Add tilde expansion to shell (#367)
* Add tilde expansion to shell

* Add tilde expansion to auto complete

* Move tilde expansion into split_args

* Add doc
2022-07-10 22:00:13 +02:00
Vincent Ollivier 2f25c4a1ef
Improve http command (#365)
* Fix host arg

* Add support for binary output

* Send binary data to stdout directly

* Remove header struct

* Refactor states

* Refactor arg match

* Add missing -v option

* Trim protocol from url

* Fix separator when listing root
2022-07-08 09:02:27 +02:00
Vincent Ollivier 3789a10df6
Improve lisp (#362)
* Parse empty strings

* Add append to core

* Add reverse to core

* Add read-line to core

* Remove prompt from read-line

* Change print return value

* Fix read-line

* Add trigonometric functions

* Update documentation

* Setup autocompletion semi-automatically
2022-07-02 15:24:30 +02:00
Vincent Ollivier e4ce2ab59c
Use exit code to set status var (#360)
* Use exit code

* Add macro_use to sys module

* Replace ExitCode with Result<usize, usize>

* Add status var

* Fix status code

* Replace status with ?

* Fix regex for var substitution

* Remove warnings

* Add temporary fix for failing tests

* Add q shortcut to calc

* Use usize for exit code

* Use process exit codes

* Reintroduce ExitCode enum

* Use ExitCode::UsageError where needed

* Display usage error in find command

* Add doc
2022-06-29 19:23:01 +02:00
Vincent Ollivier 82882ec355
Add shell aliases (#357)
* Add shell aliases

* Fix env output error

* Fix sort

* Read aliases from config file

* Simplify arguments parsing

* Fix test

* Clone params to spawn syscall

* Run clippy

* Revert "Clone params to spawn syscall"

This reverts commit 4c91bea196.

* Disable binary stripping

* Remove exit alias

* Update doc
2022-06-26 10:00:54 +02:00
Vincent Ollivier 629e254a51
Improve regex for redirections (#356) 2022-06-17 20:22:28 +02:00
Vincent Ollivier b16f5fc9fd
Store current direction in DIR shell variable (#355) 2022-06-17 20:08:55 +02:00
Vincent Ollivier 783a41981d
Add shell globbing (#352)
* Add naive implementation

* Add support for multiple files in delete command

* Update find usage

* Ignore quoted params

* Add doc

* Change argument name
2022-06-16 21:29:45 +02:00
Vincent Ollivier a177e47306
Add Coords struct to editor (#347) 2022-06-14 22:44:19 +02:00
Vincent Ollivier dd5899a74d
Read command line args from userspace programs (#351)
* Read command line args from userspace programs

* Use Stop syscall to debug pointers from userpace

* Fix address translation system

* Update binaries

* Move print to bin

* Add hardcoded alias system

* Strip debug from binaries

* Build userspace binaries before running tests

* Save all the args in args including the command invocation name

* Move sleep command to /bin

* Rebuild binaries
2022-06-14 22:43:33 +02:00
Vincent Ollivier 6e3f3afcb0
Add binaries (#350)
* Remove linker args

* Add binaries

* Read /bin for autocomplete

* Add /bin path to commands

* Remove api bin

* Remove usr reboot
2022-06-12 15:28:54 +02:00
Vincent Ollivier cd2e0166e6
Executable loading (#349)
* Add header to binary

* Add result to spawn

* Use spawn result to display error message

* Use info result to change directory

* Fix binary detection

* Fix lock issue
2022-06-09 22:59:33 +02:00
Vincent Ollivier 0831045c64
Add shell variables (#348)
* Add env vars to shell

* Add shell env

* Rename shell::run to shell::repl

* Add script pathname to shell env

* Add shell variables

* Add test

* Add doc

* Fix doc
2022-06-08 20:51:02 +02:00
Vincent Ollivier b2da75189f
Improve Lisp (#344)
* Add println

* Rewrite fib

* Refactor parse

* Update lisp completer

* Store args in env

* Add 'or' and 'and' builtins

* Add factorial.lsp

* Update docs

* Add cat operation

* Add join operation

* Add system command

* Add time command (#346)

* Add time command

* Fix merge artefact

* Fix call to realtime

* Replace clock syscalls with device files (#345)

* Replace clock syscalls with device files

* Add missing newline to read

* Update time command

* Use Rc<RefCell<Env>>

* Add first TCO

* Remove Box

* Change result of env_for_lambda

* Run clippy

* Remove env clone

* Remove TCO

* Change return type of env_for_lambda
2022-06-06 16:02:34 +02:00
Vincent Ollivier 28759df00c
Replace clock syscalls with device files (#345)
* Replace clock syscalls with device files

* Add missing newline to read

* Update time command
2022-06-05 13:58:05 +02:00
Vincent Ollivier d5512baeea
Add time command (#346)
* Add time command

* Fix merge artefact

* Fix call to realtime
2022-06-05 13:24:40 +02:00
Vincent Ollivier 530658221d
Add socket command (#341)
* Add socket command

* Add test.html page

* Refactory sending code

* Update documentation

* Fix newlines

* Add interval option

* Replace newlines

* Exit on end of transmission

* Add listen mode

* Fix arguments parsing

* Remove debug output
2022-05-21 10:46:16 +02:00
Vincent Ollivier c9998f01c2
Improve dhcp command (#335) 2022-05-05 23:29:02 +02:00