Git Product home page Git Product logo

beer's Introduction

beer

beer is a programming language.

inspiration

Most languages aim to provide strong features like

  • concurrency.
  • blazingly fast performance.
  • confusing memory safety on steroids.
  • A new package/framework/library/runtime every week.

Can't you write a project on a lazy Sunday afternoon, without worrying about the future ?

beer is a lighly brewed language, that aims to provide a simple and fun way to write code.

features

beautiful codebase

  • The codebase is designed for beginner coders to understand and contribute.
  • Aimed to be extensible and easy to hack on.
  • Smartly documented with beautiful write-up and self-explanatory code.

expressive syntax

  • The syntax is not ambiguous and is easy to read.
  • Looks beautiful and is fun to write.
  • Errors don't scold you.

batteries included

  • Comes with a suite of tools to write, test and deploy code.
  • Write, Test, Refactor quickly.

fun

  • You fall in love with coding.

syntax

variables

a: 10 b: 20

control flow

if a > b { printf("a is greater than b") }

functions

fn add(a, b) { ret a + b }

Call using

add(a:10, b:20)

fn something() { printf("something") } }`

comments

;; this is a comment ;;; this is a docstring ;;; before a function it becomes a docstring

data types

  • number, combination of int and float.
  • string, a sequence of characters.
  • boolean, true or false.
  • list, a sequence of elements.
  • table.

operators

  • +, -, *, /, %.
  • ==, !=, >, <, >=, <=.
  • &&, ||, !.
  • ++, --.

tests

  • Write a test anywhere.

  • Just use test instead of fn.

test add { a: 10 b: 20 assert a + b == 30, "addition failed" }

  • assert can test anything!

cask

  • A cask is a something like a package in other languages.

import math

  • Export functions using cask keyword.

cask { ;; mention the functions you want to export ;; you can only export functions add, }

  • Should be at the end of the file.
  • A directory with a set of files becomes a cask, that can be imported with the directory name.
  • A directory when run using beer run will find the main function and run it. It shouldn't be exported.

language

  • Open a file with .b as extension and write code.
  • Run code with beer run <filename>
  • Generate a new project with beer create
  • Test code with beer test.

beer's People

Contributors

pspiagicw avatar

Watchers

 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.