~vdupras/duskos

duskos/fs/doc/design/port.txt -rw-r--r-- 1.4 KiB
c515797bVirgil Dupras comp/c/vm/i386: fix integer promotion bug in logical ops 4 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Porting UNIX code to Dusk

Some of Dusk's goals, such as being able to visualize PDFs, imply a big chunk
of code has to be written for them. The Forth ecosystem have a few chunks of
logic here and there, but Forth being Forth, nothing is standardized and, more
importantly, it's nowhere near the UNIX ecosystem in terms of completeness.

We don't want, however, to embark on an endless journey of reimplementing this
logic. We want, instead, to be able to piggy-back on the existing code as much
as possible.

Therein lies a problem: that code is written on top of a UNIX platform, a
platform which we reject because of its complexity (see doc/design/limits). How
to reconcile these conflicting goals?

First, by counting on the fact that most of the tricky logic we want to
piggy-back on is "pure" logic and doesn't actually depend on the UNIX platform.

Second, by counting on the fact that the most important pieces of logic out
there are written in C.

Third, by creating an "almost C" compiler that tries to strike a good balance
between two conflicting goals: on the one side, stay true to Dusk OS design
goals and on the other hand, minimize the amount of work that has to be poured
into a particular piece of UNIX C code before it can be compiled and run by
Dusk.

Dusk' big bet is that with that compiler, it will be possible, with a minimal
effort, to piggy-back on existing UNIX code to provide the same logic in a much
simpler environment.