fyrlang
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Fyr

Build Status deb package rpm package npm package

Fyr is a modern systems programming language that combines the versatility of C with the ease and safety of application programming languages like Java, Go or TypeScript. Like C/C++, Fyr can be used for low-level hardware-oriented programming and high-level application programming. In contrast to C, the Fyr compiler guarantees memory safety and thread safety at compilation time.

Fyr is designed to implement all tiers of distributed IoT applications, i.e. embedded devices, server-side code and the Web UI. Furthermore, it can be combined with existing C and JavaScript code.

It is currently in early stages of development, so some features are not yet implemented and others could be removed in the future.

Installation

The compiler currently only supports UNIX-like systems, Windows support is planned for a future release.
We are currently working on providing deb and rpm packages hosted on packagecloud. An npm package is available in the standard npm registry. See the home page for more information.
Note: Installation of the npm package requires gcc to be present and working.

Usage

The package comes with the fyrc binary, which can be used to compile Fyr code into C or binary executables. We provide a plugin for Visual Studio Code that currently supports code highlighting. Integration of a language server is currently in progress but depends on some functionality of the compiler that is not yet fully implemented.

Contributing

Contributions by anyone are welcome. You can help by expanding the code, implementing more test cases, or just using the compiler and reporting bugs.

editorconfig

To ensure consistent indentation and encoding, we use the editorconfig framework. It's settings are stored in the .editorconfig file. Many applications support it natively. Please refer to the documentation on how to enable or install it.

API Documentation

The internal compiler API documentation is built using TypeDoc. To build it, run npm run build:doc in a terminal.
It will be hosted on the official documentation page.

Testing

High-level

To test the whole compiler, we have a simple script that tries to compile some test files and run the resulting binaries. It only depends on /bin/bash and date so it should run on most systems. It naively checks the exit codes of the compiler and the binaries and outputs files for which it was not 0.
To check for possible memory leaks we use valgrind. The script works without it but will complain about the missing dependency.
You can invoke it with run_tests.sh.

Unit tests

We are currently in the process of integrating unit tests into the compiler. For this, chai and mocha (+ mocha-typescript) are used. The tests can be run with npm run test or npm run test:watch.

Additionally, istanbul is used to provide test coverage reports. It can be invoked with npm run test:coverage.

To use the unit tests in editors like VS Code, the easiest way is to just run the npm: test:watch task and leave the corresponding terminal open. It will refresh on every file save and output the tests that failed.

Please not that all imports in tests have to be done through the index.ts files (only specify the folder) wherever they are present. Failure to do so will result in errors at runtime.

Package Sidebar

Install

npm i fyrlang

Weekly Downloads

0

Version

0.1.4

License

BSD-3-Clause

Unpacked Size

1.88 MB

Total Files

74

Last publish

Collaborators

  • traubenuss
  • tweis