1. 16 Dec, 2018 1 commit
    • Yorick Peterse's avatar
      Parsing of Strings into Floats and Integers · 6558d6b5
      Yorick Peterse authored
      This adds support for parsing a String into a Float and an Integer.
      There are two ways of doing so:
      
      1. By sending `to_integer` or `to_float` to a `String`.
      2. Using `Integer.from_string` or `Float.from_string`.
      
      Using `to_integer` and `to_float` will perform a lossy conversion:
      returning 0 or 0.0 for invalid input. Using the `from_string` methods
      will result in a strict conversion, with an error being thrown for
      invalid input.
      
      Fixes #134
      Fixes #156
      6558d6b5
  2. 11 Dec, 2018 3 commits
    • Yorick Peterse's avatar
      Remove SystemTime.format and SystemTime.parse · a38d0f56
      Yorick Peterse authored
      At least for the time being Inko will not provide parsing and formatting
      of times in the standard library. There are many different input and
      output formats people may need to work with, and Inko can't possibly
      support all of them. I am also not sure what format Inko _would_ support
      at this time. Since supporting this is not crucial at this time, we'll
      simply skip it altogether.
      
      See #96 for more information.
      a38d0f56
    • Yorick Peterse's avatar
      Fixed racy tests for std::env · 4a985130
      Yorick Peterse authored
      These tests could randomly fail due to some removing an environment
      variable and expecting it to remain removed, while other tests would
      re-add the variable.
      
      Fixes #154
      4a985130
    • Yorick Peterse's avatar
      Move std::reflection into std::mirror · b3c7e36f
      Yorick Peterse authored
      This moves all code from `std::reflection` into `std::mirror`, finally
      removing the need for the two separate modules. We also renamed
      `kind_of?` to `implements_trait?`, and implemented both it and
      `instance_of?` in pure Inko. This in turn allows us to remove some
      specialised VM instructions.
      
      Fixes #153
      b3c7e36f
  3. 10 Dec, 2018 1 commit
    • Yorick Peterse's avatar
      Tests for std::process and remove receive_if · bf0d6d66
      Yorick Peterse authored
      This adds tests for `std::process`, and removes
      `std::process.receive_if`. The `receive_if` method has always been a bit
      of a weird method. It was originally meant to allow some form of pattern
      matching on messages, but this turned out to be less useful than hoped
      due to the return type still being `Dynamic`.
      
      The `timeout` argument was also not used properly, and solving this
      would not be easily doable.  This is because there was no single
      operation to apply the timeout to, instead the implementation of
      `receive_if` contained two `receive` calls, and some other logic.
      Handling all this would require us to keep track of the elapsed time
      ourselves, which is rather tricky should the process be stuck in a
      blocking receive.
      
      Instead of trying to come up with all kinds of crazy ideas, I have opted
      to simply remove `receive_if` for the time being. This makes some test
      runner code a bit more fragile (in theory), but I doubt this will pose
      any real problems any time soon.
      bf0d6d66
  4. 09 Dec, 2018 4 commits
  5. 08 Dec, 2018 3 commits
    • Yorick Peterse's avatar
      Reset maiting state when there is a process · a51d1b62
      Yorick Peterse authored
      When a process was waiting for a message and there is one now, we need
      to make sure we reset the waiting state.
      a51d1b62
    • Yorick Peterse's avatar
      Removed storing of entire process statuses · 86cadf10
      Yorick Peterse authored
      Obtaining the process status has always been a bit questionable. For
      one, it's not particularly useful to see that a process is running or
      being garbage collected. Second, it requires a full 8 bytes of memory
      per process to store.
      
      In this commit, we drop the storing of full process statuses, and add a
      boolean flag "waiting for message" that we use instead where necessary.
      Currently this won't reduce the size of a process due to alignment
      requirements, but in the future we may be able to work around this by
      reducing the size of other fields.
      86cadf10
    • Yorick Peterse's avatar
      Use two survivor spaces for local allocators · 3caf9631
      Yorick Peterse authored
      Using three survivor spaces instead of two does not really offer many
      benefits, as objects surviving two collections are likely to also
      survive a third. Removing one survivor space reduces the size of a
      process by at least 32 bytes.
      3caf9631
  6. 07 Dec, 2018 4 commits
  7. 06 Dec, 2018 5 commits
    • Yorick Peterse's avatar
      Clean up code for Clippy on Rust 1.31 · 05d8972f
      Yorick Peterse authored
      The latest version of Clippy introduced some new lints, and will now
      complain about the deprecated syntax. Unfortunately, the new tool_lints
      syntax doesn't work on older Rust versions so we can not yet start
      using it.
      
      This commit also refactors various disabled Clippy lints away. Some of
      the disable lines are still necessary as Clippy is overly pedantic, but
      this at least gets rid of a large portion of them.
      05d8972f
    • Yorick Peterse's avatar
      Move histograms from buckets to allocators · f0b6fde0
      Yorick Peterse authored
      This moves the mark and available histograms outside of the Bucket type
      and into the local and mailbox allocators, reducing the memory required
      per process by at least 100 bytes. Behaviour wise nothing changes, as
      for the LocalAllocator we would evacuate objects for all Buckets the
      moment we'd find one that was fragmented.
      f0b6fde0
    • Yorick Peterse's avatar
      Use i8 for the bucket ages · 5aaa746b
      Yorick Peterse authored
      An i8 is large enough to store all values, but requires only half the
      space compared to an i16. This reduces the size of the Process type by
      24 bytes.
      5aaa746b
    • Yorick Peterse's avatar
      Use u32 for block allocation thresholds · ff158aae
      Yorick Peterse authored
      An u32 is enough to represent 128 TB worth of Immix blocks, and means a
      GenerationConfig only takes up 8 bytes of space, instead of 16 bytes.
      ff158aae
    • Yorick Peterse's avatar
      Rework storage and use of GC statistics · e5b1919f
      Yorick Peterse authored
      This commit makes two main changes:
      
      1. Various configuration statistics that were duplicated in the
         GenerationConfig type have been removed, in favour of using the
         source values from the Config type directly.
      
      2. Updating garbage collection statistics has been reworked, to prevent
         garbage collection from running too frequently.
      
      The first change results in processes requiring less memory, though we
      are talking about only a handful of bytes.
      
      The second change is more interesting. Prior to this commit, the number
      of allocated blocks was reset to the number of live blocks. If this
      number would be great enough, the next garbage collection cycle could be
      scheduled much sooner than necessary.
      
      To illustrate this, let's say our threshold is 10 Immix blocks. For the
      first garbage collection to occur, we thus need to allocate 10 Immix
      blocks. If 5 Immix blocks remain live after a cycle, we would only need
      to allocate 5 Immix blocks to trigger the next cycle; instead of
      allocating 10 Immix blocks. This commit fixes this by resetting the
      number of allocated blocks after every cycle.
      e5b1919f
  8. 04 Dec, 2018 2 commits
    • Yorick Peterse's avatar
      Removed double zeroing of Immix histograms · 0a762c81
      Yorick Peterse authored
      Immix histograms use a Chunk under the hood, and the memory for a Chunk
      is already zeroed upon allocation. Since AtomicUsize has the same memory
      representation as usize, we can just leave out the additional zeroing in
      Histogram::new().
      0a762c81
    • Yorick Peterse's avatar
      Use 1 env variable for concurrency settings · d1496336
      Yorick Peterse authored
      The number of OS threads to use for the various worker pools in the VM
      is now controlled using a single environment variable
      (INKO_CONCURRENCY), instead of using one environment variable for every
      pool. This should make it a little easier to scale things up, without
      having to set five different environment variables accordingly.
      d1496336
  9. 03 Dec, 2018 1 commit
  10. 28 Nov, 2018 1 commit
  11. 27 Nov, 2018 2 commits
    • Yorick Peterse's avatar
      Add tests for std::iterator · ab0f61db
      Yorick Peterse authored
      ab0f61db
    • Yorick Peterse's avatar
      Improve remapping of initialised type parameters · 8450931d
      Yorick Peterse authored
      This improves the compiler's support for remapping type parameters to
      the appropriate type parameter instance. For example, consider type T
      that has type parameter A initialised to type parameter B, and B is
      initialised to C. Previously, when looking up the instance of A the
      compiler would produce B. As of this commit, the compiler would produce
      type C instead. This removes the need for type annotations in various
      cases, most notably when working with iterators.
      
      Fixes #117
      8450931d
  12. 26 Nov, 2018 1 commit
  13. 25 Nov, 2018 7 commits
  14. 23 Nov, 2018 1 commit
  15. 22 Nov, 2018 1 commit
  16. 21 Nov, 2018 3 commits
    • Yorick Peterse's avatar
      Remove uninitialised params from return types · d95a357c
      Yorick Peterse authored
      This changes the compiler so that type parameters that map to
      uninitialised type parameters have their instances removed. For type
      `Thing!(A -> B)` this means that the mapping of A to B is removed if B
      is an uninitialised type parameter.
      
      This change ensures that the compiler can better handle HashMap literals
      and other types that may not initialise all type parameters. This in
      turn ensures that code such as the following no longer errors:
      
          let x: HashMap!(String, String) = %[]
      
      Previously this would error because `%[]` was inferred has
      `HashMap!(Hash + Equal, V)`, and that type can not safely substitute
      `Hashmap!(String, String)`. With this change, `%[]` is basically
      inferred as `HashMap!(?, ?)`, allowing the compiler to then infer it
      into `HashMap!(String, String)`.
      d95a357c
    • Yorick Peterse's avatar
      8cd6b796
    • Yorick Peterse's avatar
      Don't use caching for the rustfmt job · 0da7f2e1
      Yorick Peterse authored
      This job doesn't need any cache, so this should reduce the job time by
      not having to download an existing cache.
      0da7f2e1