GithubHelp home page GithubHelp logo

guoyu07 / latte-lang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jfinal/latte-lang

0.0 0.0 0.0 17.97 MB

A JVM Language. 100% interoperable with Java™

Home Page: http://latte.cassite.net

License: MIT License

Java 99.74% HTML 0.26% Batchfile 0.01% Shell 0.01%

latte-lang's Introduction

#Latte-Lang

Latte is a JVM language. It's highly readable and extensible.

Click here to watch a video about Latte.

Wiki Pages
Latte WebSite

Atom Extensions :

atom-latte-lang-highlighting
atom-latte-lang-ide

Latte supports

  • Operator Binding
  • DSL
  • Data Class
  • Pre-Processing define/undef
  • Inner Method
  • Lambda
  • JSON Literal
  • Read Eval Print Loop
  • many other features

Latte is based on java 8. It's compiled to JVM byte code, and can collaborate with any java library.

最下面有中文 :)

#How to build

JRE 8 is the only thing required.

The project is managed by Maven, you can use Maven 3 to build automatically

clone the repository, and run

mvn clean package

You will get a runnable jar (repl.jar) and two shell scripts (latte and latte.bat). The shell scripts can help you run the repl.

run:

./latte

then the REPL starts

Welcome to Latte lang
Type in expressions and double Enter to have them evaluated.
Type :help for more information.
for syntax help, please visit https://github.com/wkgcass/Latte-lang/

>1+1
|
res0 : java.lang.Integer = 2

>

#Compile lt Files There are two ways of compiling lt files

  • use program command

      latte -c <source-directory>
    

    the detailed commands and options can be found in

      latte -help
    

or:

  • start the REPL interpreter, and construct a Compiler

      compiler = Compiler()
    

    use >> operator to specify output directory

      compiler >> '...'
      // or
      compiler >> File('...')
    

    use + operator to add class-path

      compiler + '...'
    

    use compile MAP to specify source codes to be compiled and start compiling

      compiler compile {'fileName':FileObject}
    

    usually filesInDirectory('...') is used, e.g.

      compiler compile filesInDirectory('...')
    

    these method invocations can be chained up

      Compiler() + '...cp...' >> '...output...' compile filesInDirectory('...source...')
    

    You can write a script to configure the settings. Check build.lts for more info.

#Scripts

  • you can run a script directly

      latte -s script-location script-arguments...
    

or:

  • start the REPL interpreter
    type :script <script file> and Enter

    then use script run or script run ['string array'] to run the script

#Syntax For Language Syntax Help, please visit the Wiki Pages

or visit the Latte WebSite

#中文版 Chinese Version README

Latte是一种JVM编程语言。 它非常可读,同时也非常可扩展。

点击 这里 观看有关Latte的视频。

Wiki Pages
Latte 主页

Atom上的扩展插件:

atom-latte-lang-highlighting
atom-latte-lang-ide

Latte 支持如下功能

  • 运算符绑定
  • DSL
  • Data Class
  • 预处理 define/undef
  • 内部方法
  • Lambda
  • JSON 字面量
  • Read Eval Print Loop
  • 许多其它特性

Latte基于java8。它被编译到JVM字节码,可以与任何Java类库完美互通。

#如何构建工程

环境仅仅需要 JRE 8

本工程使用 Maven 进行管理,所以您也可以使用 Maven 3 进行自动Build

clone这个仓库,然后执行

mvn clean package

你将会获取一个可执行jar (repl.jar) 以及两个shell脚本 (lattelatte.bat), shell脚本可以快捷地开启repl.

执行:

./latte

接着, REPL 将开始运行

Welcome to Latte lang
Type in expressions and double Enter to have them evaluated.
Type :help for more information.
for syntax help, please visit https://github.com/wkgcass/Latte-lang/
    
>1+1
|
res0 : java.lang.Integer = 2

>

#编译 lt 文件

  • 使用程序命令

      latte -c <source-directory>
    

    详细的命令与选项可以这样找到

      latte -help
    

或者:

  • 开启REPL, 然后构造一个Compiler

      compiler = Compiler()
    

    使用 >> 运算符来指定编译输出目录

      compiler >> '...'
      // or
      compiler >> File('...')
    

    使用 + 运算符来添加 class-path

      compiler + '...'
    

    使用 compile MAP 来确定源代码并立即开始编译

      compiler compile {'fileName':FileObject}
    

    通常来说会使用 filesInDirectory('...'), e.g.

      compiler compile filesInDirectory('/Users/me/src')
    

    这些方法调用可以被串联起来

      Compiler() + '...cp...' >> '...output...' compile filesInDirectory('...source...')
    

    您可以编写一个脚本 script 来配置这些属性。查看 build.lts 以获取更多信息。

#Scripts

  • 你可以直接运行脚本

      latte -s script-file-path script-arguments...
    

或者:

  • 开启 REPL 解释器
    输入 :script <script file> 并回车

    然后使用 script run 或者 script run ['string array'] 来运行这个脚本

#语法 您可以从这两个地方获取语法规则

Wiki Pages

Latte 主页

latte-lang's People

Contributors

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