Skip to content
/ lix Public

Lix is a new language whose code is compiled into javascript . You can write async code without callback hell.

Notifications You must be signed in to change notification settings

lixinqi/lix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a.js:

var sleep = function (ms, cb) {
  setTimeout(function () {
    cb();
  }, ms);
};

sleep(20, function () {
  console.log(0);
  sleep(20, function () {
    console.log(1);
    sleep(20, function () {
      console.log(2);
      sleep(20, function () {
        console.log(3);
        sleep(20, function () {
          console.log(4);
          sleep(20, function () {
            console.log(5);
            sleep(20, function () {
              console.log(6);
              sleep(20, function () {
                console.log(7);
                sleep(20, function () {
                  console.log(8);
                  sleep(20, function () {
                    console.log(9);
                    console.log('end');
                  });
                });
              });
            });
          });
        });
      });
    });
  });
});

a.lix:

sleep := [ms]->{
  cc call [brk]->{
    ms timeout []->{
      brk call
    }
  }
}

i := 0
while (i < 10) {
  20 sleep
  i print
  i = i + 1
}

'end' print

Both of the above do the same thing. Which code is simpler and more maintainable?

Lix is a new language whose code is compiled into javascript.

Write Lix, Stop the 'callback hell'!

About

Lix is a new language whose code is compiled into javascript . You can write async code without callback hell.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published