lk

DIY programming language LK, inspired by Lua.

MIT License

Stars
8

| English

  • go go install github.com/lollipopkit/lk@latest
  • Release

CLI

lk --help

# REPL
lk
# .lk(c)
lk <file>
# .lk
lk -c <file>
# .lk
lk -a <file>

  • Step by step LANG.md
  • By examples or

// http 
resp, code, err := http.req(
    'POST', // Method
    'https://http.lolli.tech/post', // URL
    {'accept': 'application/json'}, // Headers
    {'foo': 'bar'} // Body
)
if err != nil {
    errorf('http req: %s', err) //  error(f) 
}
printf('code: %d, body: %s', code, resp)

// json 
obj, err := json(resp)
if err != nil {
    errorf('json parse: %s', err)
}
foo := obj['json']['foo']
// 
if foo != nil and foo:match('[bar]{3}') {
    printf('match: %s', foo)
}

TODO

    • // /* */
    • repeat, until, goto, .. (concat)
    • Raw String, `
    • range ( paris )
      • a ? b : c
      • a == nil ? b : a -> a ?? b
      • shy a = b -> a := b
      • shy a = fn(b) {rt c} -> shy a = fn(b) => c
      • a++ a+=b
    • Table
      • keyStringExpNameExp
      • = -> :, eg: {a = 'a'} -> {a: 'a'}
      • 0
      • metatable
      • a.0 ( a[0])
  • CLI
    • ( lk args.lk arg1 -> os.args == [lk, args.lk, arg1] )
    • REPL ./lk
      • LANG.md
      • test
    • IDE
      • VSCode

  • Vscode

License

lollipopkit 2023 GPL v3