Giter Club home page Giter Club logo

issues's People

Contributors

take-cheeze avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

johnbampton

issues's Issues

How to implement keyword arguments.

Initial implementation in CRuby:

My memo:

あと、crubyのparse.yの"kw"をgrepすればいいのでは。
あと、引数は`f_args`でやってるっぽいので、そこのblockついてるのをtailにしてkw関係のハンドリングをするっぽい

In rubyspec:

  • Spec is written in language/method_spec.rb.
  • Search the spec with keyword like a: or b:.
  • ** is rest of the keyword arguments like * in normal argument.

In Ruby Under a Microscope(Japanese edition).

  • Thanks to @keizo042 for sending me the book.
  • From the index of the book the is 4 passage and p.54 and p.109 is what we need.
  • Uses key? method to check whether argument is passed.
  • Uses delete to extract arguments from the passed Hash.

Add some documents to this repository.

  • How to move mrbgem to this organization.
  • Guidelines for travis builds under this travis or other CI.
    • Could add support to travis: Adding a new language
    • Though master of mruby breaks API without notice so may need a fork for this organization.
  • Add some common method to build autotools library.(onig[mo|uruma], libyaml, libffi, libuv)

Issue in `OP_APOST`.

Need to add space for rest array when generating OP_APOST.

@@ -1063,8 +1063,8 @@ gen_vmassignment(codegen_scope *s, node *tree, int rhs, int val)
     else {
       pop();
     }
-    push_n(post);
-    pop_n(post);
+    push_n(post + 1);
+    pop_n(post + 1);
     genop(s, MKOP_ABC(OP_APOST, cursp(), n, post));
     n = 1;
     if (t->car) {               /* rest */

Replace GC with reference counting.

Since GC is inefficient in some embedded platform usage.

The idea is from Squirrel:

mixed approach ref counting/GC

It provides weak reference type and optional GC for detecting leaked object.

For lesser memory over-head weak reference implementation I don't want to add a new field to struct RBasic.
Instead object that can have instance variables will have __weakref instance variable.
Object without instance variables will have a flag to check whether it has a weak reference and need to provide a VM specific table to get weak reference object from object pointer.

struct mrb_weakref_data {
  struct RBasic *ref;
};

void mrb_weakref_strong_deleter(mrb_state *mrb, void *p)
{
  struct mrb_weakref_data *d = (struct mrb_weakref_data*)p;
  d->ref = NULL;
}

void mrb_weakref_deleter(mrb_state *mrb, void *p)
{
  struct mrb_weakref_data *d = (struct mrb_weakref_data*)p;
  if (d->ref) {
    // TODO: need other way to release objects without instance variables
    mrb_iv_remove(mrb, (struct RObject*)d->ref, mrb_intern_lit(mrb, "__weakref"));
  }
  mrb_free(mrb, p);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.