- Nov 07, 2019
-
-
yorickpeterse-staging authored
Update README.md See merge request yorickpeterse/inko-staging-test!1
-
yorickpeterse-staging authored
-
- Oct 13, 2019
-
-
Yorick Peterse authored
Finalising objects was handled in one of two ways: 1. When reclaiming blocks we would schedule blocks that needed finalisation. These blocks were processed in a separate thread. 2. When allocating into a block that needed finalisation, all objects in this block in need of finalisation would be finalised. The idea of this approach was to move the expensive finalising of objects out of the garbage collection phase, at the cost of delaying finalisation a bit. Unfortunately, this approach was anything but simple. This finalisation approach also required various data structures taking up memory. Finally, as part of the finalisation process we would have to scan over all objects; instead of just lines. In this commit we change the approach to a much simpler one. All async related code and data structures are removed. When allocating an Immix block, we zero out the block. When allocating a new object into a previously used slot that needs finalising, we finalise the object. This delays the finalising of objects until their memory is reused. In the usual program this should not pose a problem, as memory will be reused frequently. Indeed, this is something we have observed with Inko's own test suite and a few other test programs: memory usage actually goes down due to fewer data structures needed, instead of going on.
-
Yorick Peterse authored
This reduces the size of an Option<ArcWithoutWeak<T>> from 16 bytes to just 8 bytes. This in turn can save a decent amount of memory when allocating many closures.
-
- Oct 03, 2019
-
-
Yorick Peterse authored
Instead of various modules extending a built-in type, all this logic is moved to separate extension modules. This makes it easier to figure out what module defined something, keeps the code more consistend, and gives greater control over the order in which types are refined.
-
Yorick Peterse authored
Pathname.join can be used to join a Path and a Path/String toether. Pathname.absolute? and Pathname.relative? can be used to check if a Path is absolute or relative respectively.
-
Yorick Peterse authored
This method can be used to obtain a single byte at a byte position. This in turn is useful when performing byte comparisons of strings, as it removes the need for creating byte arrays.
-
- Sep 29, 2019
-
-
Yorick Peterse authored
This is a bit shorter to type, and better signals what the AST node is meant for (e.g. the body of an "object").
-
Yorick Peterse authored
The method Iterator.partition can be used to partition an Iterator into a Pair of Array objects. The return type is the newly introduced std::pair::Pair, which is a simple binary tuple. We also introduce std::pair::Triple for ternary pairs. We do not introduce any further tuple types, as custom objects are better suited for pairs of more than three values.
-
Yorick Peterse authored
This removes the need for importing std::trait in every module. The resulting API is also less awkward to use.
-
Yorick Peterse authored
This way we use the same pattern as we do for extending Integer.
-
Yorick Peterse authored
This method returns an Iterator that iterates from 0 up to the value of the integer.
-
Yorick Peterse authored
This method allows one to select specific values from an Iterator. This requires some casts to work around the issue described in https://gitlab.com/inko-lang/inko/issues/177. We will solve this as part of the self-hosting compiler project.
-
- Sep 26, 2019
-
-
Yorick Peterse authored
This method can be used to check if an Iterator includes a certain value. This method does not reuse Iterator.find as the current Ruby compiler does not know that type parameters are instances of Object, making it impossible to use not_nil? on a ?T type.
-
Yorick Peterse authored
This method is used to check if an object is _not_ nil, making it the opposite of Object.nil?. This removes the need for writing `something.nil?.not`, which reads a bit awkwardly.
-
- Sep 25, 2019
-
-
Yorick Peterse authored
This allows custom modules to define types with the name Trait or Module. To use Trait and Module you just import them from std::trait and std::module respectively. The module std::module does not define anything useful at this time, but more useful code will be added to it in the future.
-
- Sep 21, 2019
-
-
Yorick Peterse authored
This makes it easier to implement Conditional and Equal, and makes Object a little bit less of a mess. These changes uncovered two bugs: 1. The compiler did not support looking up default methods on a trait when they were defined on Object. 2. Map.iter was not implemented correctly. If the last bucket in a Map was Nil, Map.iter would produce a Nil value. This has been fixed by the Iterator not producing values at all in this case. Originally I started working on these changes in hopes of getting rid of Object entirely. This will not be possible, as it makes Inko a bit annoying to work with. For example, Conditional and Equal would have to be implemented manually for every object, leading to a lot of boilerplate. Instead, we'll keep Object for the time being.
-
- Sep 16, 2019
-
-
Yorick Peterse authored
These jobs do not need to run for tags, saving about 10 minutes or time spent in the "test" stage.
-
Yorick Peterse authored
-
- Sep 15, 2019
-
-
Yorick Peterse authored
The parser is an LL(1) recursive descent parser. While the Ruby parser was used as a reference, it is not a 1:1 port. As part of porting the parser to Inko, several syntax changes were made: 1. "where" on methods is not supported by the Inko parser. When we start using the parser we will move "where" to traits. 2. The comments "#!" and "##" are replaced with just "#". This makes the lexer and parser internals easier, and removes the need for having to remember three different comment types. 3. Mutable rest arguments are supported in the Inko parser using "mut *NAME", instead of "* mut NAME". Using the parser is straightforward: import std::compiler::parser::Parser let parser = Parser.new(input: '10 + 2', file: 'test.inko') try! parser.parse The AST nodes are located in modules under `std::compiler::ast`. For example, integer literals are in `std::compiler::ast::literals`. For now there is some minor duplication across some of the AST nodes. For example, the types of methods (MethodDefinition) and required methods (RequiredMethodDefinition) are similar. When we start implementing the compiler we may change this around a bit, or perhaps split the AST nodes into more separate types. Fixes https://gitlab.com/inko-lang/inko/issues/172
-
- Sep 02, 2019
-
-
Yorick Peterse authored
Forks do not have access to the group runners, so their pipelines will get stuck. By disabling the MacOS and Windows tests we can ensure the pipelines at least report a proper status.
-
Mohamad Barbar authored
If printing the user argument fails, don't try to print a new line.
-
- Aug 27, 2019
-
-
Yorick Peterse authored
[ci skip]
-
- Aug 26, 2019
-
-
Yorick Peterse authored
Test group and test names are now displayed separately, an additional line is added to show the location on which the test is defined, and all output is now left aligned with the corresponding labels. This makes it easier to read the output whenever there are test failures.
-
- Aug 24, 2019
-
-
Yorick Peterse authored
This reduces the size of the various shift functions by about 1 KB when not stripping the binary.
-
- Aug 23, 2019
-
-
Yorick Peterse authored
This reduces the binary size a little bit (about 600 bytes). This is not much, but the use of format!() in these cases was overkill regardless of the binary size.
-
Yorick Peterse authored
Instead of using a macro to format integer pointers as strings, we can just use a method. This reduces the (stripped) binary size by about 16 KB.
-
- Aug 20, 2019
-
-
Yorick Peterse authored
This allows us to start certains builds (e.g. Windows runtime tests) without having to wait for all prior builds to finish.
-
- Aug 19, 2019
-
-
Yorick Peterse authored
This fixes a few warnings that will be produced when using the latest versions of Rust and Cargo.
-
- Aug 18, 2019
-
-
Yorick Peterse authored
This removes syntax support for sending messages to the result of a binary expression without using parentheses. In other words, this: foo == bar .something Is no longer parsed as `(foo == bar).something`, instead it is not parsed as `foo == bar.something`. To send a message to the result you need to use parentheses: (foo == bar).something This might be a bit more verbose, but it makes the syntax easier to parse for both humans and computers. It also makes it possible to spread the right-hand side over multiple lines when necessary. For example, prior to this MR this would not work as expected: foo == bar .baz .quix This would be parsed as `(foo == bar).baz.quix`, and not `(foo == bar.baz.quix)`.
-
- Aug 13, 2019
-
-
Yorick Peterse authored
Similar to the removal of Map literal support, this is aimed at simplifying the syntax and making it more consistent. Arrays are now created using `Array.new`, which takes every value as a separate argument: Array.new(10, 20, 30, ...) To make this more pleasant to work with, the methods `StringBuffer.new` and `ByteArray.new` now take a rest argument. This means you don't have to write `ByteArray.new(Array.new(...))`, and instead can write `ByteArray.new(...)`. For the `StringBuffer` type this requires that we manually create an instance of it. To remove the need for using VM instructions directly, we introduce `Object.allocate` as a wrapper around this. This allows one to manually create instances like so: static def some_method { let instance = allocate instance.init(...) instance }
-
- Aug 12, 2019
-
-
Yorick Peterse authored
This version no longer breaks our Unix socket tests, as this was fixed in GitHub pull request https://github.com/alexcrichton/socket2-rs/pull/40. Fixes https://gitlab.com/inko-lang/inko/issues/175
-
- Aug 11, 2019
-
-
Yorick Peterse authored
In order to simplify the syntax, hash map literals have been removed. Instead, one now creates a hash map using `Map.new`. To make it easier to create a map with a bunch of pairs in one expression, we introduce the `Map.set` method. This method behaves similar to `Map.[]=`, but returns the Map itself instead of the value written: Map .new .set('foo', 'bar') .set('baz', 'quix') So why were map literals removed? Well, first of all their syntax was not intuitive: `%[key: value]`. This syntax was taken from Elixir, but is not used in other languages that we are aware of. Many languages use curly braces (e.g. `{key => value}`), but these are already used for closures. Some languages reuse square brackets (e.g. `[key: value]`), but this makes the meaning of `[]` unclear. We considered using a syntax similar to Scala: Map.new(key -> value) Here `->` would be a method that returns some sort of tuple, and `Map.new` would take this list of tuples and use them to fill the map. The method `->` would have to be available for every object, since it's perfectly valid to use outside of constructing maps. This means `->` would have to be defined on `Object`, or in a trait that is implemented for it. Manually implementing the method/trait would be too cumbersome. The hypothetical code for this might look as follows: impl Object { def ->!(V)(other: V) -> Tuple!(Self, V) { Tuple.new(self, other) } } Unfortunately, the Ruby compiler does not support the use of self types in generic types well enough to make this work. This is a long standing issue [1], but it would require an extensive rewrite of the type system to support. Since we want to rewrite the Ruby compiler in Inko, adding support for this in the Ruby compiler would be a waste of time. There are a variety of other approaches, such as passing a closure to `Map.new` that can be used to fill up the map. All of these suffer from similar problems: the Ruby compiler's type system is a bit buggy. To work around all of this, we added the `Map.set` method. While the resulting code is a bit more verbose, it does not require any compiler changes. The API should also feel familiar to those used to immutable programming languages, which typically use a similar approach for constructing hash maps. The removal of map literals also allows us to remove various compiler optimisations of these literals, simplifying the compiler and making the language more predictable. [1]: https://gitlab.com/inko-lang/inko/issues/107
-
- Aug 07, 2019
-
-
Yorick Peterse authored
In preparation for removing hash map literals we rename HashMap to Map, which makes it a little bit easier to type.
-
Yorick Peterse authored
This simplifies the HashMap implementation, and reduces the amount of objects that need to be allocated.
-
Yorick Peterse authored
-
Yorick Peterse authored
This splits up the CI configuration into separate files, and adds support for running the tests and releases on Windows. Tests are no longer run on Rust nightly, as this does not add any value to the test suite (any more).
-
- Aug 05, 2019
-
-
Yorick Peterse authored
Version 0.3.10 of socket2 appears to contain a bug that breaks accept(2) for Unix sockets. The issue for this can be found at https://github.com/alexcrichton/socket2-rs/issues/38. For the time being we will pin socket2 to 0.3.9 so our builds pass again.
-
- Aug 02, 2019
-
-
Yorick Peterse authored
This should show up in the GitHub mirror, hopefully leading to some more sponsors.
-