Skip to content

Releases: YakshaLang/Yaksha

vP20240519.113990e 🐻

19 May 10:55
Compare
Choose a tag to compare
Pre-release

What's Changed

  • test(e2e): update snapshot for windows
  • fix(compiler,esc,tests): use topological sort for compiling structures 🪲🪲🪲 ⬆️
  • build(docker,cmakelists.txt,code-cov,llvm-fuzz): remove -static from fuzz/coverage builds ⚒️
  • refactor(type_checker,builtins,tests,slot_matcher): refactor typechecker, small fixes to types, updated error messages ⬆️
  • refactor(type_checker): improve assignment type error messages ⬆️
  • fix(type_checker): catch foreach shadowing outer scope name and throw a better error 🪲⬆️
  • refactor(ykdatatype): change recursive stringify to non recursive ⬆️
  • fix(entry_struct_func_compiler): use simple representation of types to create type names ⬆️
  • build(runtime.raylib): update raylib and raygui dependencies ⬆️
  • feat(type_checker): improve few error messages ⬆️
  • feat(compiler,runtime): better error message when member not found using levenshtein distance 🆕
  • docs(yakshaintellij): update docs.json
  • fix(builtins.cast): when sr is casted, it is converted to a string reference prior to cast 🪲 ⬆️
  • fix(to_c_compiler): string literal should compile to a valid c string literal 🪲 ⬆️
  • feat(build_runtime_docs.py): add ability to export runtime docs as a json ⬆️
  • refactor(libs.io,runtime): use sr instead of str, update runtime c code to use sr ⬆️
  • refactor(libs.w4): use sr instead of str ⬆️
  • docs(yakshaintellij): update docs.json
  • fix(generate_raylib): add missing return for must prefix
  • refactor(libs.raylib): use struct keyword for structures ⬆️
  • refactor(libs.c): remove VoidPtr and use AnyPtr ⬆️
  • refactor(libs.raylib): use c.CStr instead of str
  • refactor(libs.strings): update lpad,rpad,endswith to use sr
  • refactor(libs.strings): use sr instead of str for strings.yaka library
  • docs: generate runtime c library docs 📖
  • refactor(runtime): remove civetweb,mbedtls until wrapper code is added
  • feat: add ability to control adding paths to the doc json files
  • ci(github-actions): copy bin\release binaries to bin
  • ci(github-actions): attempt to fix windows ci build
  • test(test_compiler): use proper library path when compiling
  • ci(github-actions): do not use ninja build on windows
  • ci(github-actions): simplify action files
  • docs(readme): update readme about macos

vP20240414.f76ff03 🔨🛠️

14 Apr 11:09
Compare
Choose a tag to compare
Pre-release

What's changed

  • ci: fix tar.gz paths when packaging
  • ci(github-actions): fix manual release script path
  • ci(github-actions): navigate to clone directory
  • ci(github-actions): update task versions, debug manually_release action
  • build(manual_release): change version structure
  • ci(release): add manual release feature
  • feat(dump.cpp): add ability to look at full project, more information 🆕
  • build(cmake): do not static build in macos 🪲
  • feat(compile): print errors as json for yaksha compile command 🆕
  • fix(yakshaintellij): update target idea version
  • fix(yakshaintellij): fix binary numbers
  • feat(vscodeplugin): add directive keyword
  • build(cmake): static build
  • style(parser): clean up dead code
  • fix(parser): negative numbers are converted to a single literal 🪲
  • feat(libs.console): colour line printing 🆕
  • fix(yakshaintellij): support directives with optional string argument 🆕
  • feat(yakshaintellij): add directive statement support
  • fix(runtime): add ability to ignore setmode failure
  • feat: ability disable codegen and only verify 🆕
  • fix(libs.fileformats.ini): fix ini wrapper code
  • feat: directives to use minimal mode 🆕
  • feat: add no_stdlib directive 🆕
  • refactor(def_class_visitor): capture directives to codefiles
  • feat: initial implementation of directive statement 🆕

v0.0.7 - 🦶 🪲

04 Mar 23:21
Compare
Choose a tag to compare

What's Changed

  • feat(libs): use sr in libs (wip)
  • feat: implement/fix json exports - ast and definitions
  • fix(cmake): add whereami.c to binaries 🪲
  • fix(runtime): mman_win no longer include windows.h in header 🪲
  • fix(runtime): do not include _mingw.h in unix 🪲
  • fix(yakshadmp): save metadata for macro, and write comment to generat…
  • feat(intellij-plugin): add support for macros in the tool window 🆕
  • feat(ast-dump): add flag for main check, type check to be enabled if …
  • build(actions): add coverage,fuzz actions
  • build: fix cov/fuzz scripts 🪲
  • docs(readme): add status badges for coverage/fuzz 🆕
  • test: do not save errors to a global and instead create an error_prin… 🪲
  • fix(parser): throw a proper error when dimension of a fixed array is … 🪲
  • feat(yakshadmp,libdocs): generate mdx 🆕
  • feat(libdocs): create a docs.yaka summary of the library 🆕
  • feat(libdocs): write nice comments for docs.yaka

v0.0.6 - FixedArr Implementation 🤔

25 Feb 09:12
Compare
Choose a tag to compare

What's Changed

  • fix(carpntr): do not use linker arguments in windows to enable gui builds, fix is to be determined later
  • feat(libs.os): add chdir 🆕
  • feat(libs): add cstrlen,wrap_cstr_z 🆕
  • fix(libs.c): fix c.char! macro to generate a character correctly
  • feat(yaksha_lisp): add explode_string builtin 🆕
  • fix(usage_analyzer): visit return datatype of a def
  • fix(libs.c): fix type in macro
  • fix(type_checker): native consts are not ignored
  • feat(carpntr): use clang or gcc compiler if zig-cc is not available 🆕
  • refactor(libs): use sr in libs (wip)
  • fix(compiler): save module path to inferred object type
  • fix(parser,yakshalisp): properly define import reference
  • refactor(libs.console): use string reference instead of str
  • fix(builtins): cast to int before doing - 1 in fixedarr builtin
  • feat(const_fold): const fold data structures and refactoring (wip)
  • feat(esc): improve data type naming 🆕
  • fix(compiler,esc): ensure fixed arrays use typedefs, proper foreach with fixed arrays
  • fix(compiler): validate numbers
  • fix: improve errors - attach location
  • fix(parser,ast): mark if const statement is a global or not
  • test(parser,compiler): use .ast.l and .c as snapshots
  • feat(parser,ast): add locate functions
  • feat(const_fold): constant folding (wip)
  • feat: introduced new fixed size array data type 🆕
  • feat: initial skeleton version of ast export feature

Full Changelog: v0.0.5...v0.0.6

v0.0.5 - 🍏 MacOS / c style for loop, string references, inlinec, make

18 Dec 18:35
Compare
Choose a tag to compare

What's new

Release changes

  • MacOS build 🍏
    • You need to chmod +x <binary> for all the 4 binaries
    • You need to xattr -d com.apple.quarantine <binary> for all the 4 binaries
chmod +x carpntr
chmod +x hammer
chmod +x yaksha
chmod +x zig
xattr -d com.apple.quarantine carpntr
xattr -d com.apple.quarantine hammer
xattr -d com.apple.quarantine yaksha
xattr -d com.apple.quarantine zig
  • Linuxgnu libc build in addition to musl build 🐧
  • Now the release builds are done using 2 different github actions (Windows 🪟, MacOS 🍏)
  • From now on we only support .7z archives. (It is cross platform and open source, and lot more efficient than a .zip file) 🗜️

C Style For

  • Alternative loop similar to c-style programming languages.
def main() -> int:
    for (x = 0; x < 10; x = x + 1):
        println(x)
    return 0

String references sr

def do_something(s: sr) -> int:
    print("Printing sr: ")
    println(s)
    return 0

def takes_str(s: str) -> int:
    print("Printing str: ")
    println(s)
    return 0

def main() -> int:
    oi = "Oi"
    do_something(oi)
    takes_str("Oi oi")
    return 0

Optimisation

  • Initial version of usage analyser and deadcode eliminator.

Better C integration make and inlinec

@nativedefine("struct foreign")
struct Foreign:
    pass

def main() -> int:
    a: Ptr[Foreign] = make("Foreign")
    b: Ptr[Foreign] = inlinec("Ptr[Foreign]", "make_foreign_ptr()")
    return 0

Number autocast

  • Now you can assign smaller sized numbers to larger numbers.
  • Bool is casted to 1 or 0 when assigned to numbers.
def main() -> int:
    a = 0
    b = True
    for (x = 0; x < 10; x = x + 1):
        a += b 
    println(a)
    # Note - return can be omitted
    0

Libraries

unittest

  • New unittest (macros) library.
  • Note the console import is also required. 💀
import libs.unittest as u
import libs.strings as s
import libs.console as console

u.test_case!{"libs.strings.contains"}:
    u.assert_true!{"""strings.contains("", "")""" (s.contains("", ""))}
    u.assert_true!{"""strings.contains("a", "a")""" (s.contains("a", "a"))}
    u.assert_true!{"""strings.contains("ab", "a")""" (s.contains("ab", "a"))}
    u.assert_false!{"""strings.contains("a", "ab")""" (s.contains("a", "ab"))}
    u.end_test_case!{}

u.test_case!{"libs.strings.startswith"}:
    u.assert_true!{"""strings.startswith("", "")""" (s.startswith("", ""))}
    u.assert_true!{"""strings.startswith("a", "a")""" (s.startswith("a", "a"))}
    u.assert_true!{"""strings.startswith("ab", "a")""" (s.startswith("ab", "a"))}
    u.end_test_case!{}

u.run_all!{}

io

  • Various file io functions - fseek_*, fwrite, etc.
  • Memory mapping io - mmap, munmap, etc. (Works in Windows too 😀)

numbers

  • Endian conversion - to_le16, to_be32, etc.

Change Log

  • feat(builtins): make and inlinec builtins #48 by @JaDogg in #65
  • Feat improvements by @JaDogg in #66
  • New sr wrapped-string-reference data type by @JaDogg in #67
  • feat(compiler,type_checker,tests): implement number auto widen by @JaDogg in #68
  • feat(usage_analyser,multifile_compiler,compiler): dead code elimination by @JaDogg in #69
  • feat: add c-for, license update by @JaDogg in #70
  • few improvements by @JaDogg in #71

Full Changelog: v0.0.4...v0.0.5

v0.0.4 - YakshaLisp macros & structure literals 🤓🤓

30 Jul 12:57
Compare
Choose a tag to compare

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

v0.0.3 - for loops & desugar compiler 🚗

07 Apr 19:45
Compare
Choose a tag to compare
  • Introduced for loops & desugar compiler.
    • for x: int in int_array -> for each loop
    • for: -> end less loop
    • while xx: -> while loops are further desugared
  • Fixed bug with block analyzer
  • Fixed bug with how while loop was compiled
  • Upgrade 3rd party libraries - utfcpp
  • Upgrade raylib to 4.6-dev

Full Changelog: v0.0.2...v0.0.3

v0.0.2

01 Apr 19:56
Compare
Choose a tag to compare

😁 v0.0.2 - Bunch of features and fixes

What's Changed

  • Fix missing library dependencies on Linux by @mshockwave in #16
  • Add (extremely) basic Github Actions for Linux development by @mshockwave in #17
  • fix(string_utils): missing cstdint by @rurban in #26
  • 2 new features -> native constants, @onstack

New Contributors

Full Changelog: v0.0.1...v0.0.2

v0.0.1

18 Mar 23:40
Compare
Choose a tag to compare

Initial Release ⚡

  • wasm4 fantasy console support (w4 is required in path)
  • raylib support
  • console applications
  • raylib hot reloading *no state saving
  • wasm compilation (emcc is required in path)

Full Changelog: https://github.com/YakshaLang/Yaksha/commits/v0.0.1