HNHacker News
TopNewBestAskShowJobs

vbit

344 karma · joined September 14, 2013

submissionscomments
vbit··on Coroutines and Fibers: Why and When
I generally prefer coroutines myself but this article doesn't cover some points well.

'Fair scheduling' - nobody writes single threaded programs that process requests sequentially. It's either a thread-per-request system vs. a coroutine-per-request system. Threads are generally going to be more fair at scheduling since they are preemptive. Most coroutines are cooperative (Python, Lua) - so a long running coroutine (stuck doing some CPU cycle) will block all other inflight requests and cause latency variance. Some systems are preemptive (Erlang) so they don't suffer from the variance.

The benefit of coroutines is you can have a very large number of coroutines, probably orders of magnitude more than the number of threads - so coroutine-per-request models will scale much more than threads-per-request. The article is spot on about the context switching cost - it's so much cheaper to switch between coroutines.

You can also use multiple request per threads and use async IO, but that's the same as using coroutines with a much worse programming model.

vbit··on Atom text editor 1.4 released
I don't think pixel level customization is a major factor in bloat or performance. Doing it on top of a browser is what adds the majority of the overhead IMO.
vbit··on Solus 1.0 Released
Ok so what is Solus? Yes it's an OS as I can see from the home page but what's the ancestry? Is it too much work to mention 'Linux distro' or 'Linux-based' on the home page (or any other page of the site for that matter)?
vbit··on LÖVE 0.10 released with iOS and Android support
Heh yes, a very common complaint. I don't like it either, but the trade off still seems worth it.
vbit··on Is Sound Gradual Typing Dead? [pdf]
> To change a data structure in a statically-typed language, you change the declaration then fix any compile errors. It is easy in most cases.

Right. This can become an overhead in a rapidly evolving design because every small type change has implications across the codebase. With dynamic typing, you only need to fix the code paths you are currently interested in and development is very focussed in a way - you don't have to shuffle all parts of the code through your mental caches. This way you can iterate over a few revisions to the types without having to 'fix everything' each time. Finally when you're happy, you go ahead and fix the other dependent code. Admittedly, dynamic languages may not help you find the code that needs fixing. This problem is somewhat mitigated by tests.

vbit··on LÖVE 0.10 released with iOS and Android support
Can you make networked multi player games in love that work on mobile?
vbit··on LÖVE 0.10 released with iOS and Android support
Does love work well with moonscript?
vbit··on Creating a Virtual Printer Using Node.js [video]
How is that better than 'print to google drive' from chrome or android?
vbit··on Terra: A low-level counterpart to Lua
> You can cover literally the first two things with LuaJIT.

Not at all. You don't have explicit control over generating machine code in LuaJIT. OTOH all Terra functions - whether dynamically generated or pre-written - will get compiled to machine code via LLVM. So it's explicit, i.e. more work, but more predictable. Arguably Terra code generation will cover more scenarios - consider some code paths may not be JITable at all by LuaJIT (due to NYI) but if you can generate a Terra function, you're guaranteed machine code.

> If you're using Lua to not use Lua, you never wanted to use Lua to begin with!

You're using Lua as a meta-programming language for Terra. If you know Lua, it could be a lot more convenient than using custom or archaic meta-programming languages.

vbit··on Terra: A low-level counterpart to Lua
The front page describes three distinct use cases for Terra.

While criticism is welcome, it certainly appears that you are missing the uses for Terra. Consider the third case - you can write Terra functions (cleaner syntax than C) and use Lua as a meta-programming language that produce more Terra functions (vastly superior to C macros) which then compile down via LLVM to machine code. Your final code has no Lua pieces.

vbit··on Gmail, We Need to Talk
I feel uncomfortable using maps these days too. Something about the dynamic moving and bouncing of elements when I'm just moving my mouse makes me insecure. I can't easily figure out where to find things.

I've started to use bing more recently.

vbit··on Nim 0.12.0 released
Why so?
vbit··on Show HN: Metabase, an open-source business intelligence tool
Perhaps, but many companies have a 'Abosolutely No AGPL' policy which effectively reduces adoption.
vbit··on Microsoft Expands Its Parental Leave, Bolsters Paid Time Off And 401k Matching
An employer may offer free sushi and beer on Fridays. Does it mean they encourage fish and alcohol consumption? What about employees who don't consume either due to health or religious reasons, or just plain preference? Do they now deserve make-up compensation?

As a parent I never come in late and stay for dinner. This means the dinner service is an employer cost that I get no benefit from. Clearly the single people are the primary reason for this unnecessary cost to the company. I also don't drink soda and I'm not sure why my employer encourages this behavior by spending so much money on free soda everywhere. Lets nix that too!

Maybe you see what I'm getting at. The employer is just trying to accommodate and please people with various life choices for good retention and hiring rates. There's no reason that they absolutely shouldn't offer something to kid-free people only, it's just that they don't currently, probably because they don't think it will help much.

vbit··on Microsoft Expands Its Parental Leave, Bolsters Paid Time Off And 401k Matching
You're not a parent, are you? ;)

- I seriously doubt this leave will have any bearing whatsoever on whether an employee decides to have kids. It is such a major, life changing and personal decision it is taken irrespective of incentives. Only serious constraints (no money) might negatively impact that decision. As a new parent, I was very happy to get leave from my company but I would have had kids regardless. Also I never heard of anyone having kids so they could get the 12 weeks or whatever or leave :)

- Another way to look at this is you have people that are having kids and people that are not. What can the company do to keep the former happily employed/interested in joining your company?

vbit··on Looking for new LuaJIT maintainers
What's the disadvantage of subprocesses?
vbit··on Go channels, goroutines and GC available in Nim
Well you can already use Nim threads (http://nim-lang.org/docs/threads.html) and channels (http://nim-lang.org/docs/channels.html) - the model is similar although the implementation uses system threads rather than coroutines.

Nim also has lightweight coroutines using `async` and `await` (http://nim-lang.org/docs/asyncdispatch.html) - you can run a bunch of these within one thread.

Also, have a look at gevent for Python.

vbit··on Where Rust really shines
Garbage collected languages handle this fine too.
vbit··on Kythe – A pluggable ecosystem for building tools that work with code
how does this compare to srclib?

https://srclib.org/

vbit··on Sophia: A modern embeddable key-value database – v1.2.2 released
Ah, thanks - didn't know that. Tarantool is very interesting, btw.
vbit··on Sophia: A modern embeddable key-value database – v1.2.2 released
I don't think so.

Tarantool uses an async evented IO model, but uses Lua coroutines and not Javascript. There are not callbacks, just 'yield points'.

Also, the primary data store backend is an in-memory database with optional 'snapshoting' to disk. An alternative backend uses sophia, so it's not 100% in memory.

vbit··on Sophia: A modern embeddable key-value database – v1.2.2 released
Do you know which version of Sophia it uses?
vbit··on “Implement text editor DOM updates manually instead of via React”
Just curious - why replace vim or emacs?
vbit··on DigitalOcean now supports FreeBSD
Running ps in a jail will show the processes in the jail only.

Processes in the jail will only see network interfaces and other devices that have been explicitly exposed to the jail.

As others have said, it's like a vm with no virtualization overhead. You can set up jails with the entire Freebsd fs hierarchy so it runs like another host with its own users. Note that even the root user in a jail is not the same as the real root user. You can then use pkg to install packages within the jail too.

vbit··on DigitalOcean now supports FreeBSD
As a developer you might find jails useful. I use them to create multiple isolated 'virtual machines' on the same machine. In each one I can install a different set of packages and I like the my base system in clean. With zfs, I also snapshot each jail before major changes so rollback is easy. Try this and see how easy, well-integrated it is as opposed to something similar on linux.

I use ezjail, btw.

vbit··on DigitalOcean now supports FreeBSD
Why did journaling interfere with automatic backups?
vbit··on A Quick Comparison of Nim vs. Rust
I believe you can turn off the GC for Nim. Then you're just limited to libraries that don't rely on the GC, and fully manual memory management.
vbit··on Ori File System
Usually I want only a subset of my synchronized data on my phone. Can I set this up so all my data is synced to my nas but only some to my phone?
vbit··on Open Sourcing Our Go Libraries (2014)
I agree that gevent is a hack. however goroutines correspond to greenlets rather than gevent. You could write clean asynchronous io libraries in python using just greenlets and then it's not a hack.

I wonder if dropbox evaluated this option or just rejected python outright.

vbit··on Open Sourcing Our Go Libraries (2014)
It does. I execute many db and filesystem queries in parallel with single threaded Python using gevent.

I'm not quite sure whether dropbox didn't or couldn't get gevent or a similar system to work - it's fairly straightforward.

← PreviousPage 3 of 5Next →