~jojo/Carth

Update license preface in README
Change to dual license of Anti-Capitalist software license / AGPLv3+
Explicit class constraints in type sigs

    (define: transmute'
        (forall (a b) (where (SameSize a b))
                (Fun a b))
      transmute)
Update std lib with io & networking stuff and add gemini client ex.

Also some other updates to std, as prerequisites for the gemini
implementation. The gemini example uses some simple networking code
and works as a sort of regression test for the recent struct layout
fixes, since it was when I started working on this that FFI stuff
broke way back when xd.
Fix representative struct layout yet again

So the recent commit that made sure to leave no implicit padding
didn't solve all our issues. I cba to explain it all now, I just want
to move on. Read the diff and in particular the updated comment on
`defineDataTypes`.

Now, (Maybe Int) is represented as {i64, i64} instead of {i8, [15 x
i8], [0 x i64]} as in the recent fix or {i8, i64} before that. LLVM /
ABI / FFI related.

Ugh, I'm getting tired of thinking about padding, alignment, and
calling conventions. I just want to do fun stuff!
rename test COMMIT_TMP.carth to COMMIT_44eff82c6474.carth
Fix segfault when representing variant contained implicit padding

Before the fix, a type like `(Either (Fun _ _) [Int8 Int])` would be
repersented by the `[Int8 Int]` variant. The 8 bytes of the captures
pointer in the Fun variant would occupy the same space as the Int8 + 7
byte padding of the representing variant. When passed as an argument
to a function, LLVM would think that the padding was unused space,
since it was implicit, so it would disregard it make it zeroed when
passing the Int8 (I assume through a register). This would of course
destroy the captures pointer, if the value was really of that variant.

This commit fixes the bug by changing how tagged unions are
represented in LLVM. Now, a datatype with more than one variant (and
them not nonempty) is represented in LLVM by a representing struct of
3 elements. First, the tag. Second, a byte-array to achieve the
correct size and ensure all space is explicitly seen as used by
LLVM. Third, an empty array of aligning integer type, to ensure that
the alignment of the representing type is as big as the greatestly
aligned variant.
Output fewer instructions

Does a few things.

1. Don't generate dummy closures for global functions. If we want to
call a global func, we can now do it directly, without loading and
extracting! The con, if it's even a con, is that now if we want to
pass the global func as an arg, we'll have to generate the dummy
closure wrapper on the fly. HOWEVER, this can be done in a constant
instruction, so likely still more efficient than the load from the
global reference we would previously still need to have done.

2. Don't load, store, and more for zero-sized types. Just don't output
any instruction, and return a ConstantOperand zero/undef/whatever value.

3. In `genStruct`, instead of using runtime `insertvalue` on every
single operand, first check if any of them are constant. If so, use a
constant `litStruct` with some/all pre-filled values for the initial
value to append to instead.

4. jesus im tired. Wakiing up tomorrow won't be easy...

4 fr tho. `genIndexStruct` on zero/undef vals will just return a
constant zero/undef val of the right type instead of generating
gep/extractvalue instructions. On a `Struct` value, extract the value
now at comptime. Consutanto rabu!
Don't malloc ZSTs
Don't perform ~store~ for zero-sized types
update TODO
codegen: Fix naming of lambdas
Minor refactor
Change source module structure, src/Front/ & src/Back/

I think this is a little cleaner. It started getting a bit messy with
so many source files in a single directory.
For unbound tvars after Infer, substitute with Unit & accept

Before, unbound type vars remaining after Infer resulted in a
compilation error, but there's really no reason it should (right now,
at least). If a type var is unbound at that point, it means it could
be replaced with anything. So, we now substitute all remaining, free /
unbound tvars with ~Unit~ and accept the program.

For example, an unbound tvar could result from doing something like
`(const 69 (panic "123"))`. What type is the result of applying panic?
Anything!
Remove all SrcPos stuff from Gen, Codegen, Lower, and Monomorphize!

Since we check transmute and stuff in Infer now, we can finally remove
all positioning information from the AST in the later stages. Yay!
Add virtual type classes Num, Bitwise, and Ord

to check the associated builtin virtual binops in Infer rather than Gen.
update gitignore
Check `cast` in Infer instead of Gen

Using the new virtual typeclass `Cast a b`, which as a predicate is
true then `a` can be cast to `b`, which is the case from all primitive
numeric types to eachother, and from one type to itself.
Remove transmute size checking from Gen

since we do that using type class in Infer now!
Next