HNHacker News
TopNewBestAskShowJobs

yosbelms

11 karma · joined November 12, 2015

submissionscomments
yosbelms··on Show HN: A library to use JavaScript as the query language for your API
Watchdog algorithm explained:

The Runner receivers JS code, I wrote a babel plugin [1] to insert watchdog checks inside each loop (for, while, dowhile), also in each arrow function, that checks each time a function executes.

If the check scope is async, the watchdog awaits for a Promise that resolves immediately to give the opportunity to other functions in the thread, this function collaborative, does not hijack nodejs thread, so, it is allowed to run 10 minutes default.

If the scope is not async, the nodejs thread can be hijacked, so, it is allowed to run 100 milliseconds.

The watchdog stops the function by throwing a TimeoutError if the time is consumed in each case.

Finally, a check in inserted on each `catch`, and `finally` statements for the following cases:

    try {
      // infinite loop
    } catch(e) {
      // infinite loop
    } finally {
      // infinite loop
    }
[1] https://github.com/yosbelms/remote-func/blob/master/server/f...
yosbelms··on Show HN: A library to use JavaScript as the query language for your API
Yes theres is, its name is watchdog, see https://github.com/yosbelms/remote-func/blob/master/server/w...
yosbelms··on The Idea of Lisp
I've made a Lisp that compiles to Ramda.js, the source code is simple, http://github.com/yosbelms/ramdascript
yosbelms··on JavaScript library to express concurrency patterns
Yes, js-csp is a great project. The main difference is that unlike js-csp, Getjs is bases on promises, is like a mix of co and js-csp
yosbelms··on JavaScript library to express concurrency patterns
Motivation:

This library started as a research project for https://github.com/yosbelms/cor. It got frozen months ago, but suddenly I got motivated after read https://medium.com/@theflapjack103/the-way-of-the-gopher-669.... This lib shows that JavaScript also owns resources to deal with concurrency.

yosbelms··on Cor 0.3.0 released
Most of the design of ES6 is like this due to backward compatibility. I'm very sure if the comunity behind ES6 specs designs a language for the web regardless backward compatibility, ES would be very different to what it actually is. These features you are mentioning are awesome, for sure. But ES6 is bloated for sake of having features plus backward compatibility. Cor is different, it is simple but modern, it is going in the opposite direction.
yosbelms··on Cor 0.3.0 released
Looking for simplicity. One of the goals of Cor is to have few keywords, to make it easy to learn, to get involved, and to work with. I had three possible solutions to solve the variable scoping problem.

1- `var` keyword. Like javascript. It assumes all variables are global if not declared with `var`. 2- `global` keyword. Like PHP. It assumes all variables are local unlike that is annotated with `global`. 3- Ruby-like, Coffeescript-like.

A mixing of options number 1 and 3 was chosen.

I will open an issue regarding this subject, considering your proposal for future versions.

yosbelms··on Cor 0.3.0 released
"Variable announcing" solves that issue, please see the example in the following link:

http://yosbelms.github.io/cor/docs/playground/index.html#lin...

yosbelms··on Cor 0.3.0 released
Release notes: http://ost.io/@yosbelms/cor/topics/5
yosbelms··on Show HN: Cor - the language of the web
You got it. Cor borrows from Go, C# and Python(its philosophy). The idea behind is to take the simplest parts of the those language syntaxes, combine it, and make a new one focused on productivity and readability.
yosbelms··on Show HN: Cor - the language of the web
yes, it is possible. It is primarily designed to run in the browser.

You can use every javascript library out there, through CommonJS using "use" statement, or using globals.

yosbelms··on Show HN: Cor - the language of the web
just a play on words
yosbelms··on Show HN: Cor - the language of the web
A language that compiles to javascript. Focused on simplicity, productivity and organization. Designed for large application development.