Skip to content

Releases: zdzhaoyong/Svar

v0.3.2 improve svarpy, fix memory leak

26 Oct 10:06
Compare
Choose a tag to compare

Comparing to v0.3.1, this version:

  • add jsontype() for property and arguments
  • fixed python import of class constructors
  • fixed memory leak of svarpy caused by string from python
  • improved svarpy on efficiency

v0.3.1 first version supports kwargs, fast json parsing and dumps

20 Oct 08:29
Compare
Choose a tag to compare

This version solves:

  • keyword argument parsing and extra helping things
  • fast type switch and fast json parse and dump (about 5 times faster than the v2)

Now Svar supports kwargs like this:

int add_int(int a,int b){return a+b;}

TEST(Function,Overload){
    Svar kw_f(add_int,"a"_a,"b"_a=0,"add two int");
    EXPECT_EQ(kw_f(1,2),3); // call with arguments
    EXPECT_EQ(kw_f(3),3); // b default is 0
    EXPECT_EQ(kw_f("b"_a=1,"a"_a=2),3); // kwargs

    kw_f.overload([](int a,int b,int c){
        return a+b+c;
    }); // overload is supported
    EXPECT_EQ(kw_f(1,2,3),6);
}

v0.2.2 supporting import and labmda

20 Oct 03:10
Compare
Choose a tag to compare

Comparing to version 0.2.1, now v0.2.2 supporting

  • direct import modules with svar.import()
  • labmda functions are directly supported.

Comparing to version 3, this version

  • does not support kwargs, accerated json parsing
  • support the old version svar modules

Old version:

#include <Svar/Registry.h>

auto m=sv::Registry::load('sample_module');

sv::Svar labmda = sv::Svar::lambda([](int a){return a;});

Now:

#include <Svar/Svar.h>

auto m=svar.import('sample_module');
sv::Svar labmda=[](int a){return a;};

Now you can install svar for python using:

pip3 install svar==0.2.2

First stable version with Node.js supported

16 Jul 01:28
d56ea91
Compare
Choose a tag to compare

We are happy to announce that now Svar is more stable it has been used in commercial softwares!

Changes:

  • Fix python bindings, memory leak testing
  • Implemented Node.js bindings
  • Fix bugs during commercial usage

First version implemented simple python module access

26 Apr 06:28
Compare
Choose a tag to compare