Skip to content

v0.0.4 - YakshaLisp macros & structure literals πŸ€“πŸ€“

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Jul 12:57
· 208 commits to main since this release

What's new

  • Macro support using YakshaLisp
# β•”β•β•—β”Œβ”€β”β”Œβ”¬β”β”Œβ”€β”β”¬β”¬  β”Œβ”€β”  β•”β•¦β•—β”¬β”Œβ”¬β”β”Œβ”€β”
# β•‘  β”‚ β”‚β”‚β”‚β”‚β”œβ”€β”˜β”‚β”‚  β”œβ”€    β•‘ β”‚β”‚β”‚β”‚β”œβ”€
# β•šβ•β•β””β”€β”˜β”΄ β”΄β”΄  β”΄β”΄β”€β”˜β””β”€β”˜   β•© β”΄β”΄ β”΄β””β”€β”˜
# β•”β•β•—β”¬β”Œβ”€β”β”Œβ”€β”  β•”β•— ┬ β”¬β”Œβ”€β”β”Œβ”€β”
# β• β•£ β”‚β”Œβ”€β”˜β”Œβ”€β”˜  β• β•©β•—β”‚ β”‚β”Œβ”€β”˜β”Œβ”€β”˜
# β•š  β”΄β””β”€β”˜β””β”€β”˜  β•šβ•β•β””β”€β”˜β””β”€β”˜β””β”€β”˜
macros!{
    (defun to_fb (n) (+ (if (== n 1) "" " ") (cond
        ((== 0 (modulo n 15)) "FizzBuzz")
        ((== 0 (modulo n 3)) "Fizz")
        ((== 0 (modulo n 5)) "Buzz")
        (true (to_string n))
        )))
    (defun fizzbuzz () (list (yk_create_token YK_TOKEN_STRING (reduce + (map to_fb (range 1 101))))))
    (yk_register {dsl fizzbuzz fizzbuzz})
}

def main() -> int:
    println(fizzbuzz!{})
    return 0

Read more
Philosophy & why lisp?

  • Structure literals
b: Orange = Orange {color: ORANGE, origin: SOUTH_AFRICA}

Read more

  • Skip data type (type inference) for for each elements & during defining a variable

Change log

  • feat(parser,tests): implement mini blocks support (#36) by @JaDogg in #38
  • feat(yakshaintellij): add mini statements support by @JaDogg in #41
  • fix(yakshavscode): update vscode syntax highlighting to include recen… by @JaDogg in #43
  • fix(compiler): delete desugar object by @JaDogg in #44
  • feat(ic2c): initial skeleton of ic2c by @JaDogg in #45
  • feat(ic2c): further ic2c implementation by @JaDogg in #49
  • fix(type_checker,tests): handle redefining variables in type_checker #47 by @JaDogg in #50
  • fix(type_checker): const assignment by @JaDogg in #51
  • feat(parser,tokens): syntax sugar - struct is same as @onstack class by @JaDogg in #53
  • refactor(tests): cleanup compiler tests by @JaDogg in #55
  • feat(editors,tests): utilize struct keyword by @JaDogg in #56
  • feat(compiler,type_checker,ast,parser): struct literals and allow omi… by @JaDogg in #57
  • feat(ast,parser,type_checker,compiler): remove : from struct literal … by @JaDogg in #59
  • fix(type_checker,compiler): add support for function assignment + add… by @JaDogg in #60
  • feat(type_checker,parser,intellij,vscode): foreach can now skip data … by @JaDogg in #61
  • feat: introduce yakshalisp and various refactorings and fixes by @JaDogg in #62
  • fix(yakshalisp): fixes to enable/disable print, rename set to setq by @JaDogg in #63

Full Changelog: v0.0.3...v0.0.4