Git Product home page Git Product logo

fika's Introduction

FOSSUnited    Discord


Fika is a modern programming language for the web. It is statically typed, functional and runs on the BEAM (Erlang VM).

Current status

Actively developed. Not ready for production use or HackerNews. Currently I'm working on an incremental compiler on a long running branch.

If you'd like to keep tabs on our progress, please subscribe to our updates here.

Syntax

Here's a quick walkthrough of Fika's syntax: example.fi

Running Fika programs

Fika is written in Elixir, so make sure you have that installed. Follow these instructions to install Elixir. Next, clone this repo, cd into the directory and then follow the below instructions.

Using Elixir shell

# Install dependencies and run the Elixir shell
mix deps.get
iex -S mix

# In the Elixir shell, compile and load a Fika file using the following:
> Fika.Code.load_module("example")

# Now you can run functions from the module like this:
> :example.sum(40, 2)
> 42

Using fika executable

# Create the executable
mix release

# The above command creates an executable in the path ./_build/prod/rel/bakeware/fika
# Call the function example.sum(1, 2) from the file example.fi
./_build/prod/rel/bakeware/fika exec --function="foo()" example

PS: If you're developing Fika, the recommended way to try Fika code is to use the Elixir shell which is documented above because this is faster.

Your first HTTP server

Fika comes with a web server which allows you to quickly create HTTP request handlers. Note: This web server is a prototype currently and only responds with strings and a 200 status code.

# Inside examples/router.fi

fn routes : List({method: String, path: String, handler: Fn(->String)}) do
  [
    {method: "GET", path: "/", handler: &hello},
    {method: "GET", path: "/foo", handler: &bar}
  ]
end

fn hello : String do
  "Hello world"
end

fn bar : String do
  "Bar"
end

Now start the webserver in one of two ways:

Using Elixir shell

iex -S mix
# A web server is started automatically using the router `examples/router.fi`

Using fika executable

# Create the executable
mix release

# router.fi is in the `examples` folder
cd examples
../_build/prod/rel/bakeware/fika

Now open http://localhost:9090 in the browser to see "Hello world" served by Fika. Changes to the router are picked up automatically.

Fika together!

If you'd like to be part of the Fika community, you can find us here:

Discord server
This is the best place to chat with Fika developers, ask questions or get guidance on contributing to Fika. We also livestream some talks and pair programming sessions here. Here's the link to join.

Hackers list
This is an email digest where we send out the latest updates about Fika and our ecosystem. Here's the link to subscribe.

If you'd like to contact the creator of Fika, you can find Emil Soman on twitter or drop a mail to [email protected].

Thanks

Fika's development is supported by its many contributors and the grant from FOSSUnited. Thank you!

fika's People

Contributors

emilsoman avatar polvalente avatar fabionebbia avatar sreecodeslayer avatar atul9 avatar gkpacker avatar meerasndr avatar michallepicki avatar v0idpwn avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.