Skip to content

Releases: nature-lang/nature

v0.7.0

21 Dec 11:56
502f6ea

Choose a tag to compare

nature v0.7 has achieved significant performance improvements through systematic optimizations of core modules including TCP/UDP/HTTP, CPU, string, GC, and closure. In benchmark tests, nature demonstrated unexpectedly strong performance, and there is still room for further optimization.

What's Changed

  • Closure implementation refactored, JIT mode closure removed
  • GC cleanup logic optimized, added needzero to distinguish whether a span needs cleanup
  • String constantization handling, string as vec will perform deep copy
  • HTTP server connection pool added
  • Memory allocator performance optimized
  • libuv usage refactored, removed multi-threading loop, using global loop
  • TCP library performance optimized, connection pool added
  • UDP removed libuv API, implemented using C API
  • LIR BCC instruction assembly implementation optimized
  • LIR safepoint instruction assembly implementation optimized, based on global flag to determine if GC is needed
  • LIR stack instruction assembly implementation optimized, using sp register instead of fp register
  • arm64/riscv64 added temporary variable elimination based on MOV instruction
  • Struct instantiation method changed, assignment symbol from = to : #174
  • Editor NLS module development experience optimized, added language configuration files, struct completion, auto import, module suggestions, etc. #178

Acknowledgments

Thanks to @arjendevos for code contributions to this release

Thanks to @mmachatschek @Angluca @nunu886 for financial support

Special thanks to @linky6565 for financial sponsorship, which has been a great help to the development of the nature programming language!

v0.6.0

15 Sep 14:04
4f94e1d

Choose a tag to compare

Nature 0.6 version advances with usability as its goal. With the help of packages like net, http, json, and dbdriver, the Nature programming language can now do much more, especially in server-side applications.

With further improvements to the standard library and numerous bug fixes, the Nature programming language will be able to complete more challenging projects!

What's Changed

  • linux_riscv64 compilation target support
  • const support
  • libc standard library improvements
  • New net standard library, including tcp/udp/tls/url/dns modules
  • New HTTP client standard library
  • New JSON and reflect standard libraries
  • New crypto library, including bcrypt/blowfish/hmac/md5/rsa/sha256 modules
  • New base64 standard library
  • mysql/postgresql/redis drivers https://github.com/weiwenhao/dbdriver
  • sqlite driver https://github.com/weiwenhao/nature-sqlite
  • RESTful API example including router/middleware/db pool/mail/JWT/config modules
  • GitHub CI support @JustAnotherID
  • zig build toolchain support @wzzc-dev
  • Removed break in catch/match, using the last line expression as block return value
  • testar test support for arch/os/repeat filtering
  • Use list[1..5] instead of list.slice(1, 5) for vec slicing
  • Type conversion inline optimization
  • Support for multi-line string declaration using backticks
  • Integrated nls and npkg projects directly into the nature repository, subsequent issues and code adjustments will be made directly in the main repository
  • LSP support for simple code completion
  • Fixed recycle type exceptions
  • Fixed various GC/register allocation/system ABI related bugs
  • Fixed u64 max storage exception @JustAnotherID
  • Fixed #138
  • Fixed #134
  • Fixed #133
  • Fixed #116
  • Fixed #114
  • Fixed #107
  • Fixed #103
  • Fixed #101
  • Fixed lsp nature-lang/nls#1
  • Fixed lsp nature-lang/nls#5
  • Fixed lsp nature-lang/nls#4

Acknowledgments

Thanks to @JustAnotherID @wzzc-dev for their code contributions to this release

Thanks to @felixf4xu @cn-lang @zhangchunlin @GAMIS65 for their financial support

Special thanks to @linky6565 for their financial sponsorship, which is extremely helpful for the development of the Nature programming language!

v0.5.0

15 May 17:43

Choose a tag to compare

With the release of version 0.5, the original design goals of the nature programming language have been accomplished, and the syntax API is basically stable and will not change significantly before version 1.0.

The current version of the nature source code supports compilation on the following target platforms

  • linux/amd64
  • linux/arm64
  • darwin/amd64
  • darwin/arm64

nature includes a set of test cases and standard libraries to test the usability of basic functionality and syntax, and a small set of projects to test overall usability, but has not yet been tested in medium to large scale projects.

The core work to follow will be to improve the usability of the nature programming language, including standard library refinement, performance optimization, user feedback collection, and bug fixes.

What's Changed

  • Implement coroutines based on hnes/libaco and refactor runtime based on coroutines
  • GC is further improved and fully supports coroutines
  • Error handling refactoring based on coroutines, with try + catch syntax
  • Integration with libuv to handle network IO
  • type interface support
  • Panopticon refactoring and refinement
  • Compiling os supports darwin
  • Compiling arch supports arm64
  • See help via nature -h
  • Abandon preemptive scheduling in favor of collaborative scheduling (preemptive scheduling requires huge sacrifices)
  • LIR add safepoint to assist collaborative scheduling
  • Refactor method definition to use fn extend
  • Adaptation of array type declarations to use [T;n]
  • cptr is renamed to anyptr, raw_ptr<T> is renamed to rawptr<T>
  • channel and select support
  • match syntax support
  • Standard library adds http/fs/io/mem/process/unsafe/co.mutex/os.signal
  • strings Standard library refactoring based on fn extend
  • Use fn main as entry point
  • Remove template and add #linkid function tag to customize linker identifier
  • Use testar files for use case testing
  • Add built-in macros, e.g. @sizeof(T)
  • cmake add test case test_runtime_debug, support runtime debug
  • Official website refactoring and playground support
  • lsp support nature-lang/nls

v0.4.0-beta

26 Sep 01:02
ea64e4a

Choose a tag to compare

Features

  1. Compile-time error optimization, displaying filename and line number, type errors show original type identifiers
  2. Runtime error provides stack trace
  3. Multi-line comments /****/ support
  4. Import supports prefix-less import import utils as *
  5. Small test cases parker
  6. Parameter destructuring support, example call(...vec)
  7. Generic type supports recursion type numbert = gen intergert|flotert
  8. Binary operators || && support
  9. Package management import dir support, will automatically find dir's main.n
  10. Package management import xxx_temp support, can define temp files to interact with static libraries
  11. nature struct adjusted to be isomorphic with C, can directly pass nature struct to C language
  12. Data type arr<T,len> support, allocated on the stack, isomorphic to C's T ident[len]
  13. New syntax support, nature struct defaults to stack allocation, can get a heap-allocated p through ptr<person> p = new person
  14. Type constraints after as, like var s = {} as {u8}, declares a set type constrained to {u8}, equivalent to {u8} s = {}
  15. Package management supports declaring links for static library linking and temps for template declaration
  16. New standard library for strings import strings
  17. To better interact with C, new types cptr and cptr<T> added
  18. Added built-in syntax keyword sizeof to calculate type size, usage example int s = sizeof(person)
  19. New standard libraries fmt/os/path/strings/time
  20. New template files (for interacting with C) builtin_temp (default import), dirent_temp, libc_temp, strings_temp, syscall_temp

Adjustments

  1. Type param can only be defined globally
  2. Global variables support type inference
  3. Removed set function, declare an empty set through as constraint
  4. List type definition adjusted to vec, supports declaring vec with original struct and specifying length, example var terms = vec<u8>{len=12,cap=24}
  5. String type adjusted to be isomorphic with vec, supports accessing and assigning through str[0], and supports for-in iteration
  6. Vec type method list.len() adjusted to type attribute, list.len, and supports type methods like slice/concat
  7. For loop expression errors and break and continue redeclaration errors
  8. Generic type i = gen int|int64 basic types consistent when repeatedly generated
  9. Register allocation interval_add_range adds range error
  10. set.contains() calculates hash slot error
  11. Defining fn in struct exception
  12. Linker elf rela addend calculation exception, addend = next_inst_offset - current_inst_rel offset
  13. Ssa rename exception, some linear var def not renamed
  14. Ssa calc imm domer exception, recent domer cannot be itself
  15. If multi-line expression parser parsing exception
  16. Automatic GC trigger time exception, adjusted GC trigger point to user mode
  17. malloc allocates repeated memory areas, causing GC exception due to not clearing the area, malloc actively clears the allocated area
  18. Import priority exception, local ident can override import ident
  19. Fixed gcc11 global variable redefinition error #16
  20. Fixed Memory overflow

v0.3.0-beta

04 Aug 02:23
f90a2e3

Choose a tag to compare

Features

  1. Package management tool npkg #10
  2. Cross-platform compilation based on file names, such as main.linux.n
  3. Support for string symbol escaping, e.g., var str = 'hello\nworld'
  4. Support for coercing strings to [u8] and vice versa
  5. Support for concatenating characters using the + operator and logical comparison between strings
  6. Declaration of hexadecimal literal numbers, e.g., var i = 0x1A
  7. New standard library syscall for interacting with the operating system
  8. New standard library libc for interacting with C language
  9. Declaration of an empty list's type and length through type coercion, e.g., var list = [] as [u8,5]
  10. Maps and sets also support type declarations through empty value type coercion, e.g., var set = {} as {int}
  11. New built-in type cptr, equivalent to C language's void*, commonly used for interacting with C language/OS
  12. String and list types have a new chained method raw(), which directly accesses the raw data in the heap

Changed

  1. Changed for-loop iterator for lists from k to v, e.g., for v in list
  2. Errors generated by try no longer check for duplicate receiving variables
  3. Support for function return values of type void_expr()
  4. Fixed an issue with the assembler's jmp rel8 instruction

v0.2.0-beta

04 Jul 10:24
f6248fc

Choose a tag to compare

Features

  • Added support for continue and break syntax.
  • Added as for type assertion and type coercion.
  • Added is keyword for checking specific types in union and any types.
  • Added let keyword for type inference.
  • Added support for union types #12 .
  • Added support for type aliases with parameters #13 .
  • Added generic support for global functions #13 .
  • Added support for null type and null safety. Compound types are no longer allowed to be assigned null, and variables must be initialized with a value.
  • Added support for overload resolution based on parameter types for global functions.

Changed

  • Changed catch keyword to a shorter try keyword.
  • Variables must now be initialized upon declaration, and compound types are no longer allowed to be null.
  • Removed mandatory parentheses for if and for statements. For example, if true {}.
  • Changed double quotes to single quotes for characters.
  • Renamed list.length() and map.length() to len.
  • Renamed list.delete() and set.delete() to del.
  • Renamed set.contains() to has.
  • Fixed the issue where try syntax was not available in chained calls #11 .
  • Fixed the issue where type aliases didn't support the module.type format.
  • Temporarily disabled implicit type conversions, but literal assignments like i8 foo = 12 are still supported.

v0.1.0-beta

10 May 14:49

Choose a tag to compare

Features

  • Variable definition and assignment
  • Control flow statements
  • Functions and closures
  • Type system and custom types
  • Unary and binary operators
  • Support for struct structures
  • Built-in list/map/set/tuple data structures
  • Error handling Module management
  • Cross-compilation, currently supporting the linux/amd64 target platform
  • Memory allocation and automatic garbage collection
  • Static single assignment (SSA)
  • Reflection
  • Register allocation