experimental subtyping system
Find a file
2025-06-28 01:40:36 +02:00
docs/about fixing parsing 2025-06-28 00:20:45 +02:00
example cleaning up examples 2025-06-28 00:25:37 +02:00
include fixing parsing 2025-06-28 00:20:45 +02:00
src fixing parsing 2025-06-28 00:20:45 +02:00
.gitignore infix parsing and prebind fixes 2025-06-27 02:49:14 +02:00
CMakeLists.txt added cmake presets 2025-06-26 01:28:04 +02:00
CMakePresets.json added cmake presets 2025-06-26 01:28:04 +02:00
LICENSE Initial commit 2025-04-09 14:21:40 +02:00
README.md oops 2025-06-28 01:40:36 +02:00

log-e-sappho

experimental type system implementation

getting and building

This will get you a basic build configured for development and debugging in the subdirectory build-debug/ of repository base:

git clone https://gitta.log-e.se/lnsol/log-e-sappho.git
cd ./log-e-sappho
cmake . --preset=debug
cd build-debug
make

To get sane error messages from editors using clangd for diagnostics, i.e. using the same compilation flags configured for the build by cmake, in the repo base directory link compile_commands.json:

ln -s build-debug/compile_commands.json

"Code style"

I learned C from a guy that used to hack on OpenBSD, and just got used to writing it this way. If you wanna hack on this yourself, use your judgement. Look at the rest of the code and make yours look similar. Like, who cares about rules really? Here are some guidelines tho.

80 columns text width.

Use 8 spaces wide TABS (yes, actual TABS, not just 8 spaces) for indentation and when inside while-/if-/etc. conditions that span multiple lines, indent 4 spaces + 0 or more TABS, as to separate condition from body of the conditional statement.

(Look at the following examples using a tab width of 8, otherwise they won't make much sense.)

I.e. do

if (1 /* this is a very long condition */
    == 2 /* spanning multiple lines */
	    || 2 < 3 /* and we indent like this */) {
	this = the_way;
	/* as to increase distinguishability of condition from body */
}

not

if ( /* ... */
	2 < 3) {
	eyes = bleeding;
}

Conditional statements without { .. } is okay (preferred) if the condition fits on one line.

I.e. do

if (1 /* short condition that fits on one line */)
	u = the_best;

and

if (the_variable_that_has_that_long_name = function_with_a_long_name_too(
	    arg_is_shorter_tho)) {
	gesture = clapping;
}

repository content

This repository contains:

  • a library implementation of sappho called spho.
  • a simple language parser (and soon type checker), called msph, developed in tandem with spho.
  • documentation of the sappho type system in docs/