Spirit X3 File Organization

For larger Spirit-based project, organizing the source code well can lead to more efficient builds and increased maintainability.

Of course, this is true for any project. But the heavily templated nature of even a fully realized Spirit parser makes this doubly so. Figuring out how to take advantage of separate compilation while maintaining the ability for each of the pieces to see the needed type/template information is not trivial.

Read more »

Spirit X3 Error Handling

Once your parser grammar grows beyond a few rules/parsers, handling errors will become a priority. Being able to give feedback about where things went wrong, what exactly went wrong, and possible fixes are all things you would like to provide. It might also be nice to see if you could recover the parsing process from the point of failure and continue parsing to maybe find other problems.

Read more »

Rust Move vs Copy

I’ve been looking at the Rust Ownership model . The skinny is that Rust has made mostly opposite decisions from C++. Copy vs Move An assignment in Rust is by default, a move. The original variable is declared as invalid and using it will net you a hard error at compile time. The example used in the docs is: lets1=String::from("hello");lets2=s1;println!("{}, world!",s1);That last line will not compile because s1 is no longer valid.

Read more »

The Onyx Project

I have decided to design, and build my own computer language. It will be called Onyx. I agree, that is a pretty big task. So we will take a bit at time. Design Criteria I don’t really have a whole lot yet. You might think of onyx as C++ EXCEPT - meaning, it acts like C++ EXCEPT these differences. Over time the list will grow and I’ll turn it into a full-feature language spec.

Read more »