Myrddin: Summer of Code 2018

Getting in Contact

The Myrddin hackers hang out in #myrddin on irc.eigenstate.org. We also talk on the Myrddin mailing list, which you can join from here: https://myrlang.org/list-subscribe.html

Here are the screen names of your potential mentors:

Ori Bernstein: Ori
Andrew Chambers: ac
Quentin Carbonneaux: mpu
Roberto Vargas: k0ga
Michanel Forney: tridactyla

Getting Started

How to get Selected

The most important thing you can do to get accepted is talking to us. We'll be glad to help answer questions as you explore the projects of interest. Your proposal should not be entirely new to the people evaluating it -- while the bulk of the work of writing it will be done by you, we will probably have helped flesh in details, and help make sure that you know what is involved. There's no such thing as cheating: Putting together a proposal is a collaboration, and a chance for us to get to know you.

In order to get in contact with the community, read the contributing page.

When we evaluate a proposal, we are trying to decide two things. First, we are trying to understand whether the project will be useful to us. If the end product doesn't solve a problem or improve the project, then we are unlikely to accept the proposal. Second, we are looking for evidence that indicates that you, the applicant, will successfully complete the project.

A good proposal will hit all of the following points:

Summer of Code Project Ideas

Come with your own ideas

The most motivated applicants are the ones that scratch their own itches. If you see something that's not on the list, bring it up, and we'll be thrilled to discuss it and help you put together a proposal.

Expected Results

You tell us!

Knowledge Prerequisite

Yes.

Difficulty Level

Maybe.

Mentor

We'll find one.

Autogenerating C Bindings

Currently, binding Myrddin code to C code is a painfully manual and error prone experience, where both Myrddin and C glue code needs to be written by hand. This project would take implement a program to parse C headers, and spit out both the Myrddin and the C side of the glue.

You would build on qc, a C compiler written in Myrddin. This compiler would be modified and extended into a bindings generator.

For bonus points, the few places where the C and Myrddin ABIs differ would be fixed instead of wrapped.

Expected Results

A program which, when pointed at an API description, will generate Myrddin bindings for a set of C headers.

Suggested Knowledge

Mentor

Andrew Chambers, Michael Forney

Porting Myrddin to Windows

Porting the Myrddin Runtime to Windows

Begin a port of the Myrddin progrmaming language to Windows. The porting process will involve compiler tweaks, assembly programming, interfacing with the OS at a low level and contributing to the design of Myrddin standard library.

Expected results

The standard mc toolchain can be compiled for windows using a cygwin based environment. Enough of the standard library will be functional such that the standard build tool 'mbld' can be used. This means runtime initialization, memory allocation and basic file io will work.

You would then proceed to tackle other aspects of the std library including threads, sockets and anything else you have time for.

Suggested Knowledge

Difficulty Level

Medium to Hard

Mentor

Ori Bernstein, Andrew Chambers

Implementing a Simple Package Manager

Myrddin currently has a build system, but has no package manager that integrates nicely with it. Ideally, we would have something similar to CPAN, Cargo, Go versioning, or similar tools for other languages. This project will be to design and implement a simple system to index packages, fetch them, and integrate them into the build.

Expected results

At the end of the summer, I will be able to run commands such as mbld fetch, which will get all dependent packages needed for building a piece of code, install them, and handle versioning and updating them.

Suggested Knowledge

Depends on final design. Basic HTTP, SSH, and git are likely to be necessary.

Difficulty Level

Easy to Medium, depending on design.

Mentor

Ori Bernstein, Andrew Chambers

Implement a Math Library

Right now, Myrddin does not ship with a math library. You would do some of the initial work to fix this. You will pick the most important and commonly used numeric functions, and implement them in a way that is correct, clean, and reasonably fast.

Expected results

Implementations of common mathematical functions, including trigonometric and transcendental functions.

Suggested Knowledge

Difficulty Level

Very hard.

Mentor

Ori Bernstein

Implement DWARF debug information

Curently, Myrddin debug information only supports line numbers, and showing values involves printf debugging. While this is managable, it is far from ideal. This project would implement DWARF debug information, finishing threading type information through the backend code, emitting information to track locations.

It's going to involve touching multiple projects, from the Myrddin compiler to QBE, and possibly even our assemblers.

Expected results

gdb obj/foo will work. I will be able to print the values of variables, show data structures, and generally work as expected.

Suggested Knowledge

Difficulty Level

Very hard.

Mentor

Ori Bernstein, Quentin Carbonneaux

Implement Thread Local Storage

Curently, Myrddin does not have thread local storage. This is a useful feature to have.

This would involve learning how thread local storage is implemented across several different platforms, hooking into those mechanisms, and adding the ability to generate code that will reference thread local variables.

Expected results

It will be possible to refer to thread locals in a cross platform manner.

Suggested Knowledge

Difficulty Level

Hard

Mentor

Ori Bernstein

Implement New Optimizations for QBE

QBE currently has a number of optimizations that are not implemented. A student that is interested in adding an optimization to QBE will select an optimization, make a case for why this optimization is a good choice to implemnt, and write code to implmeent it.

Expected results

QBE will have a new optimization that makes many benchmarks run faster.

Suggested Knowledge

Difficulty Level

Variable.

Mentor

Ori Bernstein, Quentin Carbonneaux

Implement new ARM backend for QBE

QBE currently supports x86-64 and arm-64. This project would add a new target architecture, 32 bit arm. This would involve refactoring the middle end to remove any target dependencies and bit size assumptions, and adding the code to emit assembly for this new system. Of particular interest is one of the various ARM platforms.

Required Knowledge

C, Compilers

Expected results

QBE will be able to emit code for the selected target architecture by the end of the summer.

Suggested Knowledge

Difficulty Level

Medium

Mentor

Ori Bernstein, Quentin Carbonneaux

Implement webassembly backend for QBE

QBE currently supports x86-64 and arm-64. This project would add a web target for QBE. This would involve refactoring the middle end to make sure that target architecture dependencies are removed, and adding the code to emit and assemble web assembly. A wasm assembler would have to be written, since we do not believe that pulling in the giant web assembly toolchains that currently exist is a good tradeoff.

Expected results

QBE will be able to emit code for the selected target architecture by the end of the summer.

Suggested Knowledge

Difficulty Level

Hard

Mentor

Ori Bernstein, Quentin Carbonneaux

Add output formats to cross-linker

Both Myrddin and SCC are in the process of migrating to our own toolchain, and removing the overly complex binutils, and instead moving to a linker and assmebler designed for cross compilation.

As part of the work to do this, we've started to implement a cross-linker, which can take object files in the Myro format, and turn it into a binary for any of our supported target architectures.

If you take on this project, you will be adding more supported target architectures, such as Mach-O or ELF. Dynamic linking to existing shared objects should be supported.

Expected Results

Being able to link for any supported platform from any supported platform.

Suggested Knowledge

Difficulty Level

Medium

Mentor

Roberto Vargas, Ori Bernstein

Add a new platform to the SCC Assemblers

As mentioned above, both Myrddin and SCC are in the process of migrating to our own toolchain. We've got an assembler for several platforms, but we will need a few more added in. Arm64, Arm32, MIPS, and many others are desired.

Expected Results:

We will be able to assemble code for the platform of your choice.

Required Knowledge

Difficulty Level

Medium

Mentor

Roberto Vargas, Ori Bernstein

Implement a DFA cache for libregex

The Myrddin regex library is currently fast enough for many purposes, but not as fast as it could be. One major source of improvement could be the addition of a DFA cache. This would be built as the regex executed, and would improve the performance of regex execution.

Expected results

Faster regexes.

Difficulty Level

Medium to hard.

Required knowledge

Mentor

Ori Bernstein, Quentin Carbonneaux

Implement a Documentation Generator

Currently, library documentation is maintained by hand. It would be nice to have some tools in Myrddin to generate documentation automatically, stitching together code, external documents, and cross referencing things appropriately.

This could be done by either adapting an existing documentation generator, or writing one from scratch.

Ideally, this generator would be able to output both manpages and HTML.

Expected Results

The ability to automatically create documentation from source code and side-text. It should check and warn (or error) if the documentation is incomplete.

Required Knowledge

Mentor

Ori Bernstein

Improve Cross Compilation

Currently, it's fairly painful to cross compile Myrddin. There's no reason for this, since we can know how to invoke the appropriate toolchains, and have no external dependencies that are difficult to set up. At this point, the bulk of the work is teaching mbld to invoke the appropriate non-native toolchains.

Expected Results

We should be able to painlessly build for any system from any other system, without trouble, assuming an appropriate toolchain is available.

Required Knowledge

Mentor

Ori Bernstein, Andrew Chambers, Roberto Vargas