https://github.com/toshimaru/metal-beta
Programming language Metal, just an idea. No imprementation
https://github.com/toshimaru/metal-beta
Last synced: 6 months ago
JSON representation
Programming language Metal, just an idea. No imprementation
- Host: GitHub
- URL: https://github.com/toshimaru/metal-beta
- Owner: toshimaru
- Created: 2015-01-01T09:57:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-07T16:02:53.000Z (over 11 years ago)
- Last Synced: 2024-04-14T18:22:24.575Z (about 2 years ago)
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metal
Programming language Metal, just a idea, no imprementation.
Inspired by Ruby, Python, CoffeeScript.
Variable
-----
```
a = 1
b = 3
c = a + b
```
Comment out
-----
```
# this is one-line comment
```
```
###
Multiple comment
###
```
Array
-----
```
ary = ['a', 1, 'bcd', 234]
```
Hash
-----
```
hash = {foo: 'bar', nyan: 'cat'}
```
Block expression
-----
Use `{}`(curly brace).
```
if true {
p 'true'
}
```
Print
----
```
print 1 # => 1
puts 1 # => 1 (one line)
```
Function
-----
```
square = (a) -> {
return a * a
}
```
```
hello = (name = 'anonymous') -> {
puts "Hello, #{name}!"
}
```
Class
-----
```
class Foo {
square(a) -> {
"public method"
}
__private -> {
'private method'
}
_protected_method -> {
'protected method'
}
}
```
Inheritance
-----
```
Class Foo < Bar {
}
```
Require
-----
```
require 'hoge'
```
Include
-----
```
Class Foo {
include Enumerablek
}
```
Condition
-----
```
if a == true {
# true
} elif a == 2 {
# else if
} else {
# otherwise
}
b = 1 if a == true
```
Other Ideas
---
* [Toml](https://github.com/toml-lang/toml) configuration
* Go implementation (ref. [anko](https://github.com/mattn/anko))
* [mruby](https://github.com/mruby/mruby)
* [streem](https://github.com/matz/streem)
* Exception?