Coder Social home page Coder Social logo

stekin's Introduction

Stekin

                                                                 __  __
                                                                 \ \/ /\
          ________________________________________________________\  /_/__
         / _______________________________________________________    ___/\
        / /\_____________________________________________________/ /\ \__\/
       / / /    __________   _______   __   ___    __    __     / / /\_\
      ( ( /    /___  ____/\ / _____/\ / /\,' _/\  / /\  /  |\  / / /  \_\
       \ \\    \__/ /\___\// /\____\// /,' ,'\_/ / / / /   || / / /
        \ \\     / / /    / /_/_    / /' ,' ,'  / / / / /| ||/ / /
         ) )\   / / /    / ____/\  /   ,' ,'   / / / / / | |/ / /
        / / /  / / /    / /\___\/ / /\ \,'    / / / / / /| ' / /
 ______/ / /  / / /    / /_/___  / / /\ \__  / / / / / / |  / /
/_______/ /  /_/ /    /_______/\/_/ /  \__/\/_/ / /_/ /  |_/ /
\_______\/   \_\/     \_______\/\_\/    \_\/\_\/  \__/   \__/

What is Stekin?

Stekin 程序设计语言是这个编程语言泛滥的时代中又一个编译型程序设计语言.

It aims at what?

简单. 从以下方面: 设计, 编码, 配置.

What is needed and how to build it?

编译源代码需要

  • GCC 4.6.x (C++ 2011 标准中的 Lambda, std::unique_ptr, Move Semantic, nullptr 支持)
  • gawk 3.1.x (AWK)
  • flex 2.5.x (词法分析)
  • bison 2.4.x (语法分析)
  • GMP 5.x (高精度算术库, 用于字面常量折叠优化)

以上配置如需改变, 请修改源码目录中的 misc/mf-template.mk, parser/lex-script, parser/syn-script

在 Stekin 源代码目录下执行 make 来编译.

编译和运行单元测试需要

  • GoogleTest 1.5.x
  • POSIX Thread 支持 (GoogleTest 依赖)
  • valgrind (内存错误检测)

不进行单元测试没关系, 并且当下单元测试覆盖率并不高

在 Stekin 源代码目录下执行 make runtest 进行测试.

编译后端代码

编译完成后会生成 stk-core.out 文件, 它从标准输入读取 Stekin 源代码, 并输出后端代码 ''片段'' 定向到标准输出.

Stekin 没有独立的后端, 它将生成 C++ 代码, 然后使用 g++ 编译这些代码生成可执行程序, 所以需要 GCC 4.4+ 进行后端编译, 此处的配置在源码目录的 stkn.sh 中

使用 bash stkn.sh 输入文件名 目标文件名 可以快捷完成编译, 如

bash stkn.sh samples/list-pipe.stkn ./a.out && ./a.out

可以编译 samples/list-pipe.stkn 生成 ./a.out 并执行它.

Stekin the language itself

请参阅 samples/README.md

Contributing

  1. Take a glimpse at coding style conventions: https://github.com/neuront/stekin/wiki/StekinCppCodingStyle
  2. Fork it.
  3. Create a branch (git checkout -b stekin_my_own)
  4. Commit your changes (git commit -a -m "I have add some kick-ass features, or I have fixed some ball-ache bugs.")
  5. Push to the branch (git push origin stekin_my_own)
  6. Create an Issue with a link to your branch
  7. Enjoy some music by Mr. Kenji Kawai and wait

stekin's People

Contributors

zheplusplus 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.