Giter Site home page Giter Site logo

4ekmah / ficus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vpisarev/ficus

1.0 0.0 0.0 23.21 MB

The programming language Ficus

License: Apache License 2.0

Makefile 0.03% OCaml 0.27% HLSL 5.61% FLUX 8.58% C 85.45% Python 0.05% CMake 0.01%

ficus's Introduction

Ficus

This is a new functional language with the first-class array support that also supports imperative and object-oriented programming paradigms. ficus compiler generates a portable C/C++ code out of .fx files.

License

The code is distributed under Apache 2 license, see the LICENSE

How to build

The compiler is written in Ficus itself and needs C/C++ compiler and make utility.

Unix (Linux, macOS, BSD, WSL, ...)

cd <ficus_root>
make -j8
bin/ficus -run test/test_all.fx # run unit tests
bin/ficus -run -O3 examples/fst.fx # run some examples, e.g. fst.fx,
                                   # optionally specify optimization level

Windows (native)

Install Visual Studio, for example Visual Studio 2019 Community Edition, open "Developer PowerShell for VS2019" from the Windows menu and type:

cd <ficus_root>
nmake
bin/ficus -run -O3 examples/fst.fx # the usage is the same as on Unix

Set environment variables

You can add <ficus_root>/bin to the PATH. You can also customize ficus compiler behaviour by setting the following environment variables:

  • FICUS_PATH can point to the standard library (<ficus_root>/lib), though ficus attempts to find the standard library even without FICUS_PATH. It can also contain other directories separated by : on Unix and ; on Windows. The directories with imported modules can also be provided via one or more command-line options -I <import_path>. Note that if a compiled module imports other modules from the directory where it resides then that directory does not need to be explicitly specified.

  • FICUS_CFLAGS is used by C/C++ compiler to build the produced .c/.cpp files. Alternative way to pass extra flags to C/C++ compiler is via -cflags "<cflags>" command-line option, e.g. -cflags "-ffast-math -mavx2".

  • FICUS_LINK_LIBRARIES contains the linker flags and the extra linked libraries. Alternative way to pass the extra linker flags to C/C++ compiler is via -clibs "<clibs>" command-line option.

How to use

(run ficus --help to get more detailed up-to-date information about command line parameters)

Here is a brief description with some most common options:

ficus [-app|-run|...] [-O0|-O1|-O3] [-verbose] [-I <extra_module_path>]* [-o <appname>] <scriptname.fx> [-- <script arg1> <script arg2> ...]
  • -app (the flag is set by default) generates C code for the specified script as well as for the imported modules (one .c file per one .fx file), then runs the compiler for each of the generated .c files and then links the produced object files into the final app. The compiled app, as well as the intermediate .c and .o files, is stored in __fxbuild__/<appname>/<appname>. By default <appname>==<scriptname>. Override the app name (and the output path) with -o option.
  • -run builds the app (see the flag -app) and then runs it. You can pass command-line parameters to the script after -- separator.
  • -verbose makes the compiler to report build progress and various information, which can be especially useful when building big apps

Ficus 1.0

TODO

(see vpisarev#4 for the decryption and the status)

Credits

ficus's People

Contributors

vpisarev avatar 4ekmah avatar andrey-golubev avatar zihaomu avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.