The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Overview

Wren is a small, fast, class-based concurrent scripting language

Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.

System.print("Hello, world!")

class Wren {
  flyTo(city) {
    System.print("Flying to %(city)")
  }
}

var adjectives = Fiber.new {
  ["small", "clean", "fast"].each {|word| Fiber.yield(word) }
}

while (!adjectives.isDone) System.print(adjectives.call())
  • Wren is small. The VM implementation is under 4,000 semicolons. You can skim the whole thing in an afternoon. It's small, but not dense. It is readable and lovingly-commented.

  • Wren is fast. A fast single-pass compiler to tight bytecode, and a compact object representation help Wren compete with other dynamic languages.

  • Wren is class-based. There are lots of scripting languages out there, but many have unusual or non-existent object models. Wren places classes front and center.

  • Wren is concurrent. Lightweight fibers are core to the execution model and let you organize your program into an army of communicating coroutines.

  • Wren is a scripting language. Wren is intended for embedding in applications. It has no dependencies, a small standard library, and an easy-to-use C API. It compiles cleanly as C99, C++98 or anything later.

If you like the sound of this, let's get started. You can even try it in your browser! Excited? Well, come on and get involved!

Build Status

Comments
  • Proposal for smarter imports.

    Proposal for smarter imports.

    I'd like to make imports work better for reusing code. The change is big enough that I thought it made sense to write it up like an actual "RFC" proposal as a separate doc. This PR tracks the proposal text itself. Feel free to comment on it here or on the mailing list.

    Rendered proposal

    opened by munificent 66
  • Extended valid identifier character list

    Extended valid identifier character list

    Regarding https://github.com/wren-lang/wren/issues/891

    This implementation is not UTF-8 complete (no emojis). But at least it gives a room for most roman/latin languages to use variable names with non ascii chars + some symbols.

    • Supported Characters: A small subset of https://en.wikipedia.org/wiki/ISO/IEC_8859-1
    opened by clsource 65
  • [RFC] Make 0 falsy

    [RFC] Make 0 falsy

    (Forked off @PureFox48's https://github.com/wren-lang/wren/pull/987#issuecomment-826284806 for visibility)

    At present,

    ... 0, empty strings, and empty collections are all considered “true” values.

    This proposal is to change +0 and -0 to be falsy. Per @mhermier's https://github.com/wren-lang/wren/pull/987#issuecomment-826361383, that is pretty easy to do.

    This change would reduce the surprise for programmers coming from other languages --- falsy zero is the case in at least the C- and Perl-family languages, and in PHP (just to pick another random example :) ).

    opened by cxw42 61
  • [RFC] Use `in` keyword as a binary operator.

    [RFC] Use `in` keyword as a binary operator.

    At present, the in keyword isn't an operator as such but a particle whose only use is within a for statement:

    for (e in seq) // blah
    

    Despite this, I keep finding myself wanting to type stuff like this:

    if (e in list)   // list
    if (i in 0..5)   // range
    if ("e" in str)  // string
    

    Now all of these scenarios can be dealt with by using the Sequence.contains method or an override thereof for a particular class:

    if (list.contains(e))   // list
    if ((0..5).contains(i)) // range
    if (str.contains(e))    // string
    

    but I think most folks would agree that it's not as nice.

    So do you think it would be worthwhile re-classifying in as an overloadable binary operator (perhaps with the same precedence as is) which would enable us to use it as syntax sugar for the contains method?

    For example:

    class String {
       // ...
       in(str) { (str is String) && str.contains(this) }
    }
    
    opened by PureFox48 48
  • [RFC] Introduce a Long type for 64-bit signed integers.

    [RFC] Introduce a Long type for 64-bit signed integers.

    One thing I miss when programming in Wren is not being able to perform (full) 64 bit integer arithmetic, as we are effectively limited to no more than 53 bits because of the way that Nums are represented.

    I've been wondering whether there might be a way to achieve this without impacting on the simplicity of dealing with smaller integers and numbers generally that the Num class gives us and have come up with an idea.

    This is a fairly rough sketch so please bear with me.

    The basic idea is to introduce a Long class into the core library. A Long object would be 8 bytes long and would be represented internally by a C99 signed long long. It would be immutable as numbers are now.

    Consequently, a Long would be a value type as a variable of that type would hold its value directly.

    The Long class would not have constructors but instead a Long object could be created in one of three ways:

    1. From a literal - an integer with an 'L' suffix. Lower case 'l' would not be allowed as it's too easily confused with the digit '1'.

    2. From a string by giving the String class a toLong method which could optionally specify a base from 2 to 36.

    3. From a number by giving the Num class a toLong method.

    The Long class itself would support all the usual integer operators:

    + - * / % & | ^ ~ << >> < <= == != >= and >.

    However, the operands would always need to be Long objects - mixed operations with Nums would not be allowed.

    We'd also need a few methods such as: largest, smallest, min, max, pow and sign as well as toNum and toString.

    Here's a few simple examples to show how some of this would look:

    var r = 123456789L                  // Long created from a literal
    var s = "123456789123456789".toLong // Long created from a String
    var t = 12345678912345.toLong       // Long created from a Num
    var u = "abcdef".toLong(16)         // Long created from a base 16 string
    var v = s + t * u                   // arithmetic operations on Longs
    var w = (s > t) && (t > u)          // relational operations on Long
    var x = s + 6                       // not allowed, can't add Num to a Long
    var y = s + 6L                      // fine
    var z = r.toNum                     // Long converted to Num 
    

    Internally all operations would be performed from the C side using long long arithmetic and conversion functions such as strtoll.

    There would clearly be a lot of work needed to implement this and so the question is would it be worth it?

    On the plus side:

    1. We'd get full 64-bit integer representation and arithmetic including bit-wise operations though the latter might necessitate an internal conversion to unsigned long long. It would probably be best for overflows to wrap rather than producing an error.

    2. As we'd just be dealing with integers, base conversions would be straightforward to implement.

    3. Integer division would be just that (i.e. any remainder would be discarded) which is something I was banging on about in #907.

    4. There would be no impact whatsoever on Num arithmetic.

    5. It would be backwards compatible.

    On the minus side:

    1. There would be a certain amount of inconvenience in not permitting mixed arithmetic with Nums.

    2. There would inevitably be an impact on the size of the core library though I don't really see how it could done as an optional module as you'd need support for Long literals in the language itself.

    3. Using a numeric suffix for literals is arguably a bit ugly but I can't think of a sensible alternative and, of course, C has used suffixes from day one.

    4. A Long would have a lower range than an unsigned 64 bit integer but I feel that the convenience of having signed integers outweighs this.

    5. There would be more for newcomers to the language to learn.

    Finally, I'd add that you could do a lot of this with a custom type which is represented internally by a List of two Nums. However, the trouble with this is that it's relatively slow and, as it's a reference type, it will be subject to garbage collection and can't be used directly as a Map key.

    I look forward to hearing what you all think.

    opened by PureFox48 38
  • Implement sum method for Sequence class

    Implement sum method for Sequence class

    This PR:

    • Implements the sum method of the Sequence class; includes tests
    • Adds documentation for the sum method.

    Examples:

    System.print([1, 3.14].sum)  //> 4.14
    System.print((1..3).sum)  //> 6
    System.print([].sum)  //> 0
    
    System.print(["string", 1, 2].sum)  //> runtime error "Can't sum non-numeric values"
    
    opened by vladyio 36
  • Add System.version

    Add System.version

    References https://github.com/wren-lang/wren-cli/issues/95

    System.version
    

    It returns WREN_VERSION_NUMBER. Was thinking of retrieving the string, or having version.major, version.minor, but I think keeping it dead simple like this is best.

    opened by RobLoach 32
  • Language: Infinity and NaN

    Language: Infinity and NaN

    Currently, due to C's double nature (and IEEE-754), you can get NaN via 0 / 0, Infinity via 1 / 0, and -Infinity via -1 / 0 (or -(1 / 0), i.e. -Infinity). Example:

    var NaN = 0 / 0
    var Infinity = 1 / 0
    var MinusInfinity = -Infinity
    System.print("NaN: %(NaN), Infinity: %(Infinity), MinusInfinity: %(MinusInfinity)") // NaN: nan, Infinity: infinity, MinusInfinity: -infinity
    System.print("NaN == NaN? %(NaN == NaN)") // NaN == NaN? false
    

    I think there are two things two improve here:

    1. The .toString is bad. Really 😺. I think it would be better to capitalize it, that is, NaN, Infinity, and -Infinity.
    2. We should have a way to construct them. There are two manners in different programming languages (you're welcome to add more languages):
      1. JavaScript uses keywords: NaN and Infinity. C and C++ use macros (NAN and INFINITY in <math.h> or <cmath>, since C99 and C++ 11), which are similar.
      2. Python, C#, Java and Rust uses methods/properties/constant. In C# it's double.NaN, double.PositiveInfinity, and double.NegativeInfinity (or their float counterparts). Java has similar names: Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY. Python has math.nan and math.inf since 3.5; before that, the recommended way was to convert from string (see https://stackoverflow.com/a/7781273/7884305, https://stackoverflow.com/a/19374296/7884305). Rust has f64::NAN, f64::INFINITY, and f64::NEG_INFINITY (or f32 counterparts). C++ also has methods, inside <limits>, std::numeric_limits<{double, float, long double}>::{infinity, quiet_NaN, signaling_NaN}().

    I think the methods approach is better. However, do we need to also insert Num.negativeInfinity or no because users can just do -Num.infinity?

    opened by ChayimFriedman2 29
  • [RFC] Introduce top-level static methods

    [RFC] Introduce top-level static methods

    The purpose of this proposal is to make procedural programming in Wren easier and more familiar to users of other languages by introducing top-level static (TLS) methods. This is how they'd look compared to top-level functions:

    static method(s) {
      System.print(s)
    }
    
    var function = Fn.new { |s|
      System.print(s)
    }
    
    method("I'm a static top-level method")
    function.call("I'm a top-level function")
    

    Unlike functions, TLS methods would not be objects and so they could not be passed to, or returned from, other methods or functions or assigned to variables. However, this means that they could be defined in the same way as class-based static methods and would not need to be invoked with 'call' as functions do to avoid the ambiguities that would otherwise arise (see #1045).

    One could perhaps think of them as if they were members of an anonymous top-level class though it would not be a precise analogy.

    Other aspects of TLS methods:

    1. Parentheses would always be needed whether they took parameters or not.

    2. They could only be defined at top-level, never within a block or nested scope.

    3. They could be recursive.

    4. They would see other top-level entities in exactly the same way as a top-level function and their internal implementation could therefore be similar.

    5. Class based methods would see TLS methods in the same way as other top-level entities and you would therefore need to observe the usual capitalization rules if you wanted to invoke them from within a class.

    6. This proposal would be backwards compatible as no new keyword would be needed and, at present, the static keyword cannot be used at top-level. Functions would continue to work exactly the same as they do now.

    This would, of course, make Wren a bit more complicated but I think it would be worthwhile as I regard the current situation of always having to use top-level functions (and their associated 'call' method) for procedural code to be not only an irritation for many existing users but an obstacle to the wider adoption of Wren for simple scripts.

    I look forward to comments.

    opened by PureFox48 26
  • Performance

    Performance

    Likewise, when you access a field in other languages, the interpreter has to look it up by name in a hash table in the object.

    I ran some tests in Swift:

    • 0.0005 for hash table
    • 0.00000618 for pointers

    Sorry for the beginner question, but why does the hash table approach differ by orders of magnitude in performance? I did not expect this.

    opened by ghost 25
  • Binding class methods and other primitives at runtime

    Binding class methods and other primitives at runtime

    I'm studying how to implement binding Wren to my classes at runtime based on my own reflection metadata, in a similar fashion as I bound lua. (https://github.com/hugoam/mud/blob/master/src/lang/Lua.cpp) I'm almost in a dead end, or all designs I can think of will end up way too complex. So I want to know if you can help me or give me some pointers :)

    The crux of the problem is that, unlike in lua where there is a function call mechanism with upvalues (for closures) at the core of the library, in Wren everything is the other way around: everything is an object, so you only ever call methods, and the C API method binding mechanism doesn't allow you to store any closure data with it : you only give a bare function pointer, which is biased towards implementing all your foreign methods manually (or generating C++ code).

    I can't bind C/C++ primitives at runtime without being able to store some "closed-over" values somehow (like a wren handle) together with the bound method in bindForeignMethod. Which, if I'm starting to understand Wren design, seems likely to be impossible.

    So I've been trying to think of ways to store a Wren handle (to a foreign class that I defined to store my callable), but since I have no way to attach it to the bound method in the bindForeignMethod handler, I need an alternative.

    Since in Wren closures seem to be a higher level construct based on the former mechanisms (objects, methods, etc...), I can think of some very contrived workarounds where I would define my closure classes, create instances of these closures for each of my primitives, and write boilerplate "proxy" methods that would call these closures in the body of the foreign class, and then compile all this Wren boilerplate. But there are two things about such a design :

    1. I'm still not sure it's entirely possible
    2. that's more an argument towards not using Wren so far, and I really wanted to provide this otherwise very neat language :)

    Did I miss something crucial that would help me implement this with Wren ? If I haven't been clear or making sense let me know too :)

    opened by hugoam 25
  • Compiler signature re-work

    Compiler signature re-work

    This patch set propose to rework how Signature works.

    The key changes in behavior:

    • SignatureType is removed, so it simplify a lot of logic by storing the subscriptArity, parenArity, isInitializer and isSetter instead. It contains some simplifications to signatureToString that should be very handy to implement #1112.
    • Compilation errors for setters should provide better error messages.
      class Foo {
        static foo = (a) { a }
      }
      
      if (!Foo.foo = 42) {
      }
      

      outputs:

      Error at '=': The setter syntax cannot be used in this context.
      

      instead of:

      Error at '=': Expect ')' after if condition.
      Error at ')': Expect end of file.                      (or any other trailing garbage error)
      
    • The last (optional) 8 patches, reduces the code size in a one liner and reduce some frictions in the languages:
      • Allow trailing commas for any argument/parameter lists (add symmetry with lists and maps):
        class Foo {
          [a,] { ... }
          bar(a,) { ... }
        }
        foo.bar(a,)
        foo[a,]
        
      • Allow function of arity 0:
        Fn.new {|| null }
        
      • Allow subscript of arity 0:
        foo[]
        foo[] = 42
        
      • Allow setters of any arity:
        class Foo {
          static [i] = () { ... }
          static [i] = (a) { ... }
          static [i] = (a, b) { ... }
          static [i, j,] = (a, b,) { ... } // support trailing in subscript and value parameter list
        }
        Foo[a] = ()
        Foo[a] = 42
        Foo[a] = (42)
        Foo[a] = (42, 69)
        Foo[a, b,] = (42, 69,) // and support trailing in subscript and value argument list
        
    opened by mhermier 34
  • announce: lexer Wren for CudaText editor

    announce: lexer Wren for CudaText editor

    Lexer was published in CudaText editor (free editor), in its addons. To install lexer: menu "Plugins / Addons Manager / Install" - find "Wren" item.

    wren

    opened by Alexey-T 0
  • [RFC] Keyword List Data Structure

    [RFC] Keyword List Data Structure

    Reading #1112 I though that Maybe a new Data Structure can be created for Wren. From Elixir's Keyword list.

    Keyword lists in Elixir are simply a special case of a list, their contents being made up entirely of 2-item "pair" tuples with the first item of each being an Elixir :atom. Unlike maps, they are ordered and may contain multiple values for the same key. Due to their prevalence in the language, a lot of syntactic sugar has been created to make working with them easier and more idiomatic. For example, during creation:

    iex(1)> [{:cats, 2}, {:dogs, 1}] == [cats: 2, dogs: 1]
    true
    

    In Wren this maybe created as

    class Keyword {
       key {_key}
       value {_value}
       construct new(key, value) {
          _key = key
          _value = value
       }
       toString {"{%(this.key),%(this.value)}"}
    }
    
    
    System.print([Keyword.new("cats", 2), Keyword.new("dogs", 1)])
    

    [{cats,2}, {dogs,1}]

    So if some sugar is added maybe

    [cats: 2, dogs: 1]
    

    becomes

    [Keyword.new("cats", 2), Keyword.new("dogs", 1)]
    

    This can be handy in #1112

    method([cats: cats, dogs: dogs]) {
       // cats and dogs
    }
    
    opened by clsource 2
  • [RFC] Support argument labels as part of method signatures

    [RFC] Support argument labels as part of method signatures

    One of the things I like about Smalltalk is the ability to define keyword labels that describe method arguments. Swift has a similar concept:

    func point(x: Double, y: Double) -> Point is called as point(x: 2.0, y: 3.0). You can define another point method func point(r: Double, theta: Double) -> Point and call it as point(r: 1.0, theta: 1.571).

    1/ In both languages the labels x:y: or the r:theta: are part of the method signature. The two are always considered different methods. You can’t accidentally call point(r:, theta:) when you mean to call point(x:, y:).

    2/ In Swift it is something you must opt-out of if you want positional arguments. It is possible to design a language where these labels are opt-in, that is you get positional arguments by default but labels if you want them.

    These are different from the keyword arguments available in many languages. In Ruby, for example, you can define a method: def point(x:, y:) and call it as point(x: 2.0, y: 3.0) but it when you call point, you always call the same point method.

    Here is my suggestion for Wren:

    1/ Add optional argument labels that are part of the method signature, as arity is part of a signature today. This would allow the programmer to define two different methods point(x: x, y: y) and point(r: r, theta: theta) and have them mean two different things.

    2/ Argument labels would be allowed only for one or more arguments at the end of the argument list. Mixing in the middle would not be allowed.

    3/ Do not add default argument values. I really like Wren’s approach of using the text at the call site to determine the method to be called. My suggestion would just add an optional new thing (argument labels) to the method signature.

    Here are some consequences of the addition:

    1/ Existing programs would continue to run. This does not change the language for any program that has been written up to this point. Programmers who would rather not use argument labels can just ignore them.

    2/ Since argument labels would be handled at compile time (as part of the method signature), this change would not have any cost in terms of interpreter speed.

    3/ Argument labels could make the programmer’s intensions much clearer when reading a method call. A method point(I, j) with arity 2 does not really communicate that the meaning of the arguments, and a the programmer could accidentally reverse them or pass in the wrong values. point(r: 1.0, theta: PI/2) is easier to understand without looking up the method’s definition.

    opened by conchis 22
  • Suspicious design around the max length of method names and max count of method parameters

    Suspicious design around the max length of method names and max count of method parameters

    I have to interop with legacy C code that have some functions which have their names longer than 64 characters and have sometimes more than 16 parameters. if one of the main use cases for such projects is to interop with some parent hosting language code, why was the limit not equal to that parent language?

    opened by xiaoxiao921 1
Releases(0.4.0)
  • 0.4.0(Apr 9, 2021)

    0.4.0 contains 145 commits from 28 contributors!

    About Wren

    Release blog post (highlights only).

    Documentation

    This release includes many documentation revisions, fixes, additions and gaps closed!

    Language

    • Add continue keyword for loops - https://github.com/wren-lang/wren/pull/822
    • Add as keyword: import "..." for Name as OtherName - https://github.com/wren-lang/wren/pull/775
    • Add Support positive sign in scientific notation - https://github.com/wren-lang/wren/pull/706
    • Add Fiber.try(value) to complement Fiber.call(value) - https://github.com/wren-lang/wren/pull/835
    • Allow . to be on a different line (for fluent/builder APIs) - https://github.com/wren-lang/wren/commit/4c496c56a6bc51c5922a5ed19b6e0ec9b1b00de6
    • Allow newlines in empty parameter lists - https://github.com/wren-lang/wren/pull/925
    • Add raw strings using triple quotes """ - https://github.com/wren-lang/wren/commit/981ea4adf1f9631dca386675f87cf88a76cc79ce
    • Add \e escape character for strings - https://github.com/wren-lang/wren/pull/963
    • Add Attributes to classes and methods - https://github.com/wren-lang/wren/pull/962

    Modules

    • Random: Random.sample optimizations - https://github.com/wren-lang/wren/pull/716
    • List:
      • Add list.sort() and list.sort {|a, b| ... } (quicksort) - https://github.com/wren-lang/wren/pull/802
      • Add list.swap(index0, index1) for swapping elements within a list - https://github.com/wren-lang/wren/commit/38f50fe091159ff8b114b9cbd0054456f7ed5366
      • Add list.indexOf(value) for finding values in a list - https://github.com/wren-lang/wren/commit/62009870a8031acf231e5fb5eba13e4f6d334a07
      • Add list.remove(value), removing by value not index - https://github.com/wren-lang/wren/commit/ecce1f6be9fb2a177e1c61577d5f1fd16e36cc80
    • Num:
      • Add Num.tau - https://github.com/wren-lang/wren/commit/89c5e224809effae59dfe3cb0e2425b23d1722f1
      • Add Num.nan, Num.infinity - https://github.com/wren-lang/wren/pull/781
      • Add Num.minSafeInteger and Num.maxSafeInteger - https://github.com/wren-lang/wren/pull/874
      • Add min(other), max(other), clamp(min, max) - https://github.com/wren-lang/wren/commit/8361217369825cd3ce730586d43f3994733b997e
      • Add cbrt for cube root - https://github.com/wren-lang/wren/pull/905
      • Add exp, log2 - https://github.com/wren-lang/wren/commit/433fbc40195ddf1c837c1c56e14e15e5633e1bb3

    Fixes

    • Fix stack corruption related to Fn calls - https://github.com/wren-lang/wren/pull/807
    • Fix a byte offset bug in CODE_IMPORT_VARIABLE - https://github.com/wren-lang/wren/commit/28ad8aa9e07f9622de3483cf67ae688a51c1cbdb
    • Fix some stack corruptions related to multiple wrenInterpret calls - https://github.com/wren-lang/wren/pull/730
    • Fixed crash when GC collects module during import 2ce421ea
    • Fix Bool, Num and Null allowing subclassing, which is invalid - https://github.com/wren-lang/wren/pull/831
    • Fix config reallocateFn being required, it can now be left out as intended - https://github.com/wren-lang/wren/commit/33ab8be7e3a32182e1397e403d6ee8a5e8b342c8
    • Fix returns in a constructor returning null, and disallow returning a value - https://github.com/wren-lang/wren/pull/845

    API

    • BREAKING: Add userData to wrenReallocateFn - https://github.com/wren-lang/wren/pull/788
    • BREAKING: Add WrenLoadModuleResult which has a onComplete callback, allowing freeing module strings - https://github.com/wren-lang/wren/pull/778
    • Add wrenGetVersionNumber for external access via the API - https://github.com/wren-lang/wren/pull/958
    • Add WREN_API prefix for correct dll exports for some compilers - https://github.com/wren-lang/wren/commit/a501fba4bbc9b3cda3574b230b5b1e8f9d4aeadd
    • Add wrenHasVariable and wrenHasModule queries, for use with wrenGetVariable - https://github.com/wren-lang/wren/commit/182ca90b8c9e14a88837699f1fa95f61d19b0f0a
    • Add wrenSetListElement to complement wrenGetListElement, and allow negative index for both - https://github.com/wren-lang/wren/commit/97ebcc72c36f8ea81ed8bbfac8e165f7ef74495f
    • Add Map functions to API - https://github.com/wren-lang/wren/pull/725
      • wrenSetSlotNewMap
      • wrenGetMapCount
      • wrenGetMapContainsKey
      • wrenGetMapValue
      • wrenSetMapValue
      • wrenRemoveMapValue

    Other

    • build; add util/generate_projects.py for regenerating project files
    • vm; Allow computed goto when using clang on Windows
    • vm; WREN_MAX_TEMP_ROOTS default is 8 (instead of 5)
    • vm; GC debug times are printed in milliseconds, not seconds

    Commits since 0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0-pre(Dec 3, 2020)

    This release is a draft.

    Language

    • Add continue keyword - https://github.com/wren-lang/wren/pull/822
    • Add as: import "..." for Name as OtherName - https://github.com/wren-lang/wren/pull/775
    • Add Support positive sign in scientific notation - https://github.com/wren-lang/wren/pull/706
    • Add Fiber.try(value) to complement Fiber.call(value) - https://github.com/wren-lang/wren/pull/835
    • Allow . to be on a different line (for fluent/builder APIs) - https://github.com/wren-lang/wren/commit/4c496c56a6bc51c5922a5ed19b6e0ec9b1b00de6

    Modules

    • Random: Random.sample optimizations - https://github.com/wren-lang/wren/pull/716
    • List:
      • add list.sort() and list.sort {|a, b| ... } (quicksort) - https://github.com/wren-lang/wren/pull/802
      • add list.swap(index0, index1) for swapping elements within a list - https://github.com/wren-lang/wren/commit/38f50fe091159ff8b114b9cbd0054456f7ed5366
      • add list.indexOf(value) for finding values in a list - https://github.com/wren-lang/wren/commit/62009870a8031acf231e5fb5eba13e4f6d334a07
    • Num:
      • add Num.tau - https://github.com/wren-lang/wren/commit/89c5e224809effae59dfe3cb0e2425b23d1722f1
      • add Num.nan, Num.infinity - https://github.com/wren-lang/wren/pull/781
      • add min(other), max(other), clamp(min, max) - https://github.com/wren-lang/wren/commit/8361217369825cd3ce730586d43f3994733b997e
      • add exp, log2 - https://github.com/wren-lang/wren/commit/433fbc40195ddf1c837c1c56e14e15e5633e1bb3

    Fixes

    • Fix stack corruption related to Fn calls - https://github.com/wren-lang/wren/pull/807
    • Fix a byte offset bug in CODE_IMPORT_VARIABLE - https://github.com/wren-lang/wren/commit/28ad8aa9e07f9622de3483cf67ae688a51c1cbdb
    • Fix some stack corruptions related to multiple wrenInterpret calls - https://github.com/wren-lang/wren/pull/730
    • Fixed crash when GC collects module during import 2ce421ea
    • Fix Bool, Num and Null allowing subclassing, which is invalid - https://github.com/wren-lang/wren/pull/831

    API

    • BREAKING: Add userData to wrenReallocateFn - https://github.com/wren-lang/wren/pull/788
    • BREAKING: Add WrenLoadModuleResult which has a onComplete callback, allowing freeing module strings - https://github.com/wren-lang/wren/pull/778
    • Add wrenHasVariable and wrenHasModule queries, for use with wrenGetVariable - https://github.com/wren-lang/wren/commit/182ca90b8c9e14a88837699f1fa95f61d19b0f0a
    • Add wrenSetListElement to complement wrenGetListElement, and allow negative index for both - https://github.com/wren-lang/wren/commit/97ebcc72c36f8ea81ed8bbfac8e165f7ef74495f
    • Add Map functions to API - https://github.com/wren-lang/wren/pull/725
      • wrenSetSlotNewMap
      • wrenGetMapCount
      • wrenGetMapContainsKey
      • wrenGetMapValue
      • wrenSetMapValue
      • wrenRemoveMapValue

    Other

    • build; add util/generate_docs.py for regenerating project files
    • vm; Allow computed goto when using clang on Windows
    • vm; WREN_MAX_TEMP_ROOTS default is 8 (instead of 5)
    • vm; GC debug times are printed in milliseconds, not seconds

    Commits since 0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jun 5, 2020)

    Blog

    Read the 0.3.0 release blog for more details, and plans for 0.4.0.

    Note You can try Wren on http://wren.io/try, and Wren CLI now has downloads.

    0.3.0 changelog

    0.3.0 is a fairly specific release, aimed at fixing build issues across platforms, streamlining the process for new users and making embedding easier. This is a stepping stone for working on language features and improving the VM, hacking on the docs and the VM is simpler than ever!

    Builds now work out of the box on all primary platforms. Previously there was issues on Windows and other platforms due to unix-ey workflows being the default.

    All the python scripts have also been fixed and updated (to python 3), and work consistently across all platforms out of the box too (including the tests, benchmarks, metrics etc). Like before, there was some things that didn't hold up on Windows or Mac. Fixed!

    A lot of work has been done to also clarify the distinction between the CLI project and the VM, as well as move the CLI to it's own repo! This removes a lot of code that wasn't being used, and also been clarified the project structure.

    Docs have also had a clean up, and a new page to try Wren directly on the doc page was added.

    Language/VM

    • CLI moved to own repo
    • Use premake for project generation, see projects/
    • Fix builds across platforms. "Just works" on all primary platforms.
    • Fix amalgamated script generator and amalgamated build
    • Fix unicode parsing and other issues in all python scripts
    • All python scripts are python3 now, and run on all platforms correctly
    • Test runner isolated and unified for VM tests
    • Remove SASS and Pygments requirements from docs, just python now
    • Updated docs to clarify VM/CLI split
    • Added Try page for running wren code in the docs
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Oct 1, 2019)

    Blog

    Read the 0.2.0 release blog for details, and plans for 0.3.0.

    0.2.0 changelog

    0.2.0 spans a pretty wide time period with around 290 commits. This includes many bug fixes, improvements, clarity in the code and documentation and so on. There are some minor API changes, be sure your header is up to date so the compiler can tell you what changed. There's too many changes to explicitly list, so below is the obvious user facing stuff that was easy to spot in the history.

    Most noteworthy is that 'relative imports' are a slightly breaking change, but help pave the way forward toward a consistency for modules.

    Language/VM

    • import was made smarter, differentiating relative from logical
    • Fiber can now accept a value from the first call/transfer
    • Improved performance/distribution of number hashing (details)
    • Added String.trim, String.trimEnd, String.trimStart variants
    • Added String.split, String.replace, String.fromByte
    • Added String.indexOf(needle, startIndex)
    • Added Sequence.take and Sequence.skip
    • Added Num.pow, Num.log, Num.round
    • Added Num.largest, Num.smallest
    • Added List.filled(count, value)
    • Added Map iteration (MapEntry)

    C API

    • Added wren.hpp for use in c++
    • Added void* user data to WrenVM
    • Added wrenAbortFiber
    • Allow hosts with no module loader to still load optional modules.

    CLI

    Please note that beyond 0.2.0 the CLI will have it's own changelog. This list is not exhaustive. For a fuller history see the commit log above.

    • Add path module
    • Add --version
    • Add REPL written in Wren
    • Add Stdin.isTerminal
    • Added Platform class
    • Rename process module to os
    Source code(tar.gz)
    Source code(zip)
Owner
Wren
Organization for the Wren programming language
Wren
ArkScript is a small, fast, functional and scripting language for C++ projects

ArkScript Documentation Discord server: invite link, to discuss the specification of the language and receive help Modules Nota bene: the project is r

ArkScript 479 Nov 18, 2022
A proof-of-oncept module adding real-time Wren support to Godot

Godot Wren Module This module adds a new node, called WrenManager, that allows for executing Wren code in Godot during runtime! Wren is a cool lightwe

null 3 Nov 28, 2021
RemixDB: A read- and write-optimized concurrent KV store. Fast point and range queries. Extremely low write-amplification.

REMIX and RemixDB The REMIX data structure was introduced in paper "REMIX: Efficient Range Query for LSM-trees", FAST'21. This repository maintains a

Xingbo Wu 80 Nov 1, 2022
Simple, fast, JIT-compiled scripting language for game engines.

Aftel Aftel (acronym for «A Far Too Easy Language») is a programming language, primarily intended to serve as an embeddable scripting language for gam

Rosie 17 May 20, 2022
A small and fast programming language.

Pocketlang is a small (~3000 semicolons) and fast functional language written in C. It's syntactically similar to Ruby and it can be learned within 15

Thakee Nathees 1.4k Nov 17, 2022
StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that of JavaScript's and TypeScript's

StarkScript StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that

EnderCommunity 5 May 10, 2022
PLP Project Programming Language | Programming for projects and computer science and research on computer and programming.

PLPv2b PLP Project Programming Language Programming Language for projects and computer science and research on computer and programming. What is PLP L

PLP Language 5 Aug 20, 2022
🎩 An interpreted general-purpose scripting language 🔨

Dunamis Version 0.0.0.2 - Alpha Version 1.1 An interpreted general-purpose programming language Contents Syntax Functions Variables Objects Enums Incl

Tech Penguin 4 Dec 21, 2021
a C++ scripting language

/>mpl setup />mpl requires CMake and a C++ compiler to build, rlwrap is highly recommended for running the REPL. $ cd ampl $ mkdir build $ cd build $

Andreas Nilsson 2 Nov 6, 2021
A scripting language written in C

News KGScript will be rewritten from scratch in C or C++ (a big update) Usage Usage: ./KGScript file.kgs [options] Examples prints("Example") printi(1

null 16 Nov 12, 2021
ACL - A simple scripting language made in c++

ACL ACL is a simple and easy to learn language. ACL is a compiled language, made with C++. For code examples look at the examples/ folder. We would ap

Niclas 10 Nov 1, 2022
The UwU's Scripting language. Made with love for UwU Nyanny Commuwiwwy!

UwUscript UwUscript is a scripting language. Installation Prerequisite LLVM 10.0 flex and bison. CMake 3.10 Build Clone this repository. git clone htt

UwUssimo Robinson 7 Oct 30, 2022
A small, fast codeforces command line tool for competitive programming.

chainsaw: A Codeforces Commandline Tool chainsaw is a small and faster drop-in replacement for your copy and paste while attending Codeforces contests

Jiawei Wang 40 Nov 9, 2022
SJTU ACM Honors Class - Programming 2021

?? 图书管理系统 ?? SJTU ACM班 2021级 程序设计课程大作业 ?? 目录 ?? 简介 ?? 作业说明 ?? 评测方式 ?? 分数组成 ⏱ 中期检查 ⏱ 检查时间表 ?? 项目说明 ??‍?? 开发要求 开发文档 Github 仓库管理 代码风格 ?? 业务需求 交互方式 用户系统 图

null 4 Jul 16, 2022
rax/RAX is a C++ extension library designed to provide new, fast, and reliable cross-platform class types.

rax rax/RAX is a C++ extension library designed to provide cross-platform new, fast, and reliable class types for different fields such as work with I

MaxHwoy 5 May 2, 2022
Dynamic 3D cellular automata engine with lua scripting support

Cell3D Cell3D is a dynamic 3D cellular automata engine with lua scripting support Installation Dependencies: Lua 5.3 Raylib Simplest possible build co

null 2 Oct 7, 2022
Unity Scripting in C++

Unity Native Scripting A library to allow writing Unity scripts in native code: C, C++, assembly. Purpose This project aims to give you a viable alter

Jackson Dunstan 1.2k Nov 24, 2022
An REFramework plugin that adds Direct2D scripting APIs

REFramework Direct 2D This is an REFramework plugin that adds a Direct2D scripting API. Building Currently suggest building in RelWithDebInfo so that

null 20 Oct 24, 2022