Readit News logoReadit News
Direct commented on Writing a small ray tracer in Rust and Zig   nelari.us/post/raytracer_... · Posted by u/cyber1
tntn · 6 years ago
> I wrapped my objects in atomic reference counters, and wrapped my pixel buffer in a mutex

Rust people, is there a way to tell the compiler that each thread gets its own elements? Do you really have to either (unnecessarily) add a lock or reach for unsafe?

Direct · 6 years ago
It's a library, so only half an answer to your question, but there's a fantastic library called rayon[1] created by one of the core contributors the the Rust language itself, Niko Matsakis. It lets you use Rust's iterator API to do extremely easy parallelism:

  list.iter().map(<some_fn>)
becomes:

  list.par_iter().map(<some_fn>)
Seeing as in the original example code, the final copies into the minifb have to be sequential due to the lock anyway, all the usage of synchronization primitives and in fact the whole loop could be replaced with something like:

  let rendered = buffers.par_iter().map(<rendering>).collect();  
  for buffer in rendered.iter() {  
    // The copy from the article  
  }
I've not written much Rust in a while, so maybe the state of the art is different now, but there are a lot of ways to avoid having to reach specifically for synchronization primitives.

Direct commented on Avast open-sources its machine-code decompiler   blog.avast.com/avast-open... · Posted by u/matt_d
Direct · 8 years ago
Really cool stuff. I don't like being negative when it comes to fantastic moves like this, but I'm still really disappointed that it doesn't support 64bit executables.
Direct commented on Remotely tunneling to a server using an iPad Pro for programming   jann.is/ipad-pro-for-prog... · Posted by u/TheArcane
TheArcane · 8 years ago
> I can develop literally anywhere

Except on airplanes.

Direct · 8 years ago
Or underground trains, or long tunnels, or hikes, or many things. Hopefully though the typical developer doesn't spend the majority of his time on an airplane. Me personally, I don't need to be coding so consistently that the loss of a few hours on a plane is going to stop me doing this.
Direct commented on Remotely tunneling to a server using an iPad Pro for programming   jann.is/ipad-pro-for-prog... · Posted by u/TheArcane
anopows · 8 years ago
Which service do you use for renting a server?
Direct · 8 years ago
Used to use a SoYouStart E5-1650v2 for the 6 Core/12 Hyper-Threads. I moved when I got a sweet server auction deal with two Xeon's but recently moved to Hetzner because the price for their AX50 Ryzen 1700X + 32GB of RAM is hard to beat.
Direct commented on Remotely tunneling to a server using an iPad Pro for programming   jann.is/ipad-pro-for-prog... · Posted by u/TheArcane
DigitalSea · 8 years ago
Should be titled, "I remotely tunnel to a server using my iPad Pro for programming" very misleading. Furthermore to the point: what's the benefit of tunneling to a remote machine for dev work? The latency would suck as would the overall slowness of things, it would drive you insane. You can hammer nails into a piece of wood using a rock, but why would you when you can use a hammer?
Direct · 8 years ago
I have been doing this for 4 years. I can rent a 16 core server for a couple of years for less cost than a low entry Macbook, with a 1Gbps line. With mosh, I can develop literally anywhere with no lag at all (or at least, no noticeable lag) even with a 3G connection. I can RDP to an EC2 Windows instance when I need a quick Windows machine, again with minimal lag even over 3G.

I sold my desktop, and now use a cheap £200 garbage laptop as a thin-client to my machine. Not only do I get incredible compile performance due to being able to use 16 core Xeon's, but I am not tied to any desktop.

I can whip out my phone and pop open a tmux session from anywhere, in an emergency I can hop onto a friends computer and thanks to SSH 2FA fearlessly login to my dev system with my full environment that I never have to close.

At this point, I would actively avoid jobs that wouldn't let me work this way. Currently got a sweet remote gig and I'm going to fly to Spain next week and spend a couple of weeks coding on the beach with my 3G tethered laptop.

Edit: Just to clarify, I don't need to work in an IDE or use any Windows software that I couldn't tunnel over X. So it might not work for everyone. Just wanted to give an example of it working out great for someone.

Direct commented on CouchDB 2.0   blog.couchdb.org/2016/09/... · Posted by u/k__
bdcravens · 9 years ago
> The second major feature is the declarative query language “Mango”.

Nice name :-)

Direct · 9 years ago
I wonder if the design is based on some of the solid research that went into MangoDB[0].

[0]: https://github.com/dcramer/mangodb

Direct commented on Kakoune – An experiment for a better code editor   kakoune.org/... · Posted by u/Somasis
mawww · 10 years ago
Thanks a lot for you reply, I try to be reactive to feature requests, especially easy ones like making something configurable through an option (I expect most of these to be resolved in a day or so).

Some people are using kakoune with fzf, using tmux to open a split, which is very simple to implement with fzf-tmux. Interacting with Kakoune interface ought to be possible but possibly more tricky.

Direct · 10 years ago
Yeah, I can't see how I would do it. I could open a tmux pane with fzf and run another kak window but that's not really the goal. I'd like to use fzf to open a found file in the current kak window. The plugin architecture just really limits this kind of thing, and this fzf example was just a simple one I wanted to use to demonstrate the point.

But again, the stuff you have in this editor is absolutely fantastic, really, I can't say that enough. I just personally find kak less flexible than an already inflexible vim so I couldn't stay with it.

If you have a way to do the fzf example though I'd be curious to see how you do it.

Direct commented on Kakoune – An experiment for a better code editor   kakoune.org/... · Posted by u/Somasis
mawww · 10 years ago
Hello,

Glad to hear you liked the interaction model, may I ask you what kind of options were missing for you ?

The extension model is, I agree, unorthodox, but I think it does work reasonably well (the file you linked manage to provide asynchrounous clang completion and syntastic like diagnostics using it), and keeps things simple. Note that we try really hard only to depends on POSIX tools, so the scripts are actually targeting POSIX shell.

The rational behind this extension model can be found there: https://github.com/mawww/kakoune/blob/master/doc/design.asci...

And a more in depth explanation on how to use it is there: https://github.com/mawww/kakoune/blob/master/doc/interfacing...

Direct · 10 years ago
Honestly it's been a little while, I can't remember. However this is more or less why I went back to vim. Your other comment in particular:

> We do not have options for everything, but I'll gladly add more options if there is a reasonable use case for them. In other words, options only get added if someone requests them (and makes a good case for them).

I don't really want to switch to an editor where missing options might have to be justified. I'm not knocking your work, it's really good, and my complaint applies to vim as well. But if I can't implement something myself as an add-on (which I definitely have more power to do in vim) and have to wait for it to be patched and released in your release cycle I'd rather just try and implement your features in vim and keep the customisability.

Having said that I could be wrong and maybe the plugin system is more powerful than I thought. But as an example, I have a 5 line function letting me have ctrl-p like functionality backed by fzf in vim. I can't figure out how I would do that in kakoune at all.

Direct commented on Kakoune – An experiment for a better code editor   kakoune.org/... · Posted by u/Somasis
Direct · 10 years ago
I tried switching to this editor permanently from vim. The selection based movements are asurdly good, I could kill for something like this in vim.

However I couldn't stick with it for two reasons. The first is when I went to figure out how to customise it, I found that the customisation is essentially vim like but weaker. Everything is hardcoded like it would be in vim but with less options. If you're used to Emacs insane customization, this is the other end of the spectrum. The stuff that IS customisable works by executing embedded bash scripts[1]!? You can only embed these in specific hooks and places, so it's really limited, and platform specific. Install this on a system missing a bash feature someone is using and who knows how it'll behave.

Basically, the features implemented are gorgeous, but past that I can't stick with it. Just going to consider trying to port the selection based movements to a vim plugin but I think it'll be a challenge.

1: https://github.com/mawww/kakoune/blob/master/rc/clang.kak

Direct commented on Atom 1.0   blog.atom.io/2015/06/25/a... · Posted by u/mrbogle
coldtea · 10 years ago
Can't you just pick a different layout in the OS -- and that will remap the physical buttons?
Direct · 10 years ago
I think having to remap your systems keyboard to something other than your native language in order to use an editor is a bit unreasonable.

Typing accented characters is far easier in Spanish with a Spanish layout, that we all grow up with. The software shouldn't just ignore half the planet on the basis of "use English".

u/Direct

KarmaCake day73December 21, 2012View Original