Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
RX14
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
211.
▲
by
RX14
10y ago
I've taken to using gnu parallel over xargs at all opportunities because I find it much easier to use. I find the parallel commands much shorter and easier to understand. Added to the fact it's more featureful and I find it pretty
212.
▲
by
RX14
10y ago
> The question is, how easy is it to make syntax-driven tools? You can actually require the lexer and parser portions of the compiler in crystal code, and get an AST from a file relatively easily. The crystal compiler then has tools for
213.
▲
by
RX14
10y ago
Parallelism isn't easy, so the core team is expending time to get it done correctly and released before 1.0. Crystal doesn't have anything like the GIL, and the compiler already enforces some simple rules, like type flow not being
214.
▲
by
RX14
10y ago
> language primitives easily producing efficient primitives of the machine I think crystal already does this well, especially in release mode when llvm gets to optimise the program as a whole. This also seems like something that can be i
215.
▲
by
RX14
10y ago
Github has had this type of problem before, and it seems that they handle it pretty well. I think as long as a single repository doesn't become a massive hotspot, Github don't really mind. I'm pretty sure that go checks out d
216.
▲
by
RX14
10y ago
The answer is technically yes but you probably don't want to. Crystal comes with a managed runtime and gc, which are particularly unsuited for use in a shared library. However you can export c functions (it's a hidden feature) and
217.
▲
by
RX14
10y ago
Actually, I'll expand on that and say that crystal isn't "static typing for rubyists", its more like "the best bits of ruby applied to static typing". There's a big difference in that the bits of ruby that
218.
▲
by
RX14
10y ago
You seem to make the assumption that crystal's purpose is to be for ruby developers, and as soon as it deviates from ruby, you've switched gears and might as well use Java or C. I don't think that's the case. Crystal tak
219.
▲
by
RX14
10y ago
Crystal has websockets built into the standard library, and as with almost everything built in crystal it uses evented io. Here's a benchmark: http://serdardogruyol.com/benchmarking-and-scaling-websocket...
220.
▲
by
RX14
10y ago
Ruby is quite a large language with a large ecosystem of libraries, but I have never seen or heard of major issues with module name clashes. Libraries tend to have quite unique names and stick to their modules. Crystal works pretty much the
221.
▲
by
RX14
10y ago
No, actually Crystal.
222.
▲
by
RX14
10y ago
Crystal uses libgc, from the readme: [0] "Since the collector does not require pointers to be tagged, it does not attempt to ensure that all inaccessible storage is reclaimed. However, in our experience, it is typically more successful
223.
▲
by
RX14
10y ago
Crystal has an excellent concurrency story built into the stdlib which is on by default. All io is evented by default, with events being fed into the fiber scheduler. The nice thing is that the concurrency and evented io is built just using
224.
▲
by
RX14
10y ago
What a surprise to see crystal at the top of HN again! I've been using and contributing to crystal since 2015 too, and I've come to really love the language and community. A big thank you to all the community for being so welcomin
225.
▲
by
RX14
10y ago
To expand on that, it produces dynamically linked binaries so you do need libevent, libpcre, libgc etc. when you want to run crystal binaries. We hope to get the number of runtime dependencies down in the future.
226.
▲
by
RX14
10y ago
Because crystal's nil type can have methods on, it already feels like an Option<T> with `#try`. We've had a lot of discussion about nil handling, but haven't come up with a better solution yet. Simple patterns like `ret
227.
▲
by
RX14
10y ago
I'm sorry what? Crystal's type system is both expressive and safe compared to most languages. It has generics, tagged type unions and dynamic dispatch. It has a built in spec runner and testing suite which are highly usable and pr
228.
▲
by
RX14
10y ago
What exactly do you find missing with shards? Its simple, its decentralized, and it works great. Most of all its a standard.
229.
▲
by
RX14
10y ago
Unfortunately its a compiled language so you can't drop into a pry repl like ruby. It does emit debug symbols, and both gdb and lldb work with it, I just haven't gotten around to working out if they're useful for more than pr
230.
▲
by
RX14
10y ago
I'm still running my moto g with 4gb of ram and it performs perfectly fine, even on latest android. If the moto g has aged so well I can guarantee you the market share of phones with <= 4gb ram is quite large.
231.
▲
by
RX14
10y ago
Oh wow, this happened to me last night when I was trying to scan something! I was sure that I had broken it somehow but I guess not. Super surprising to me to see the reason my printer is broken on HN anyway.
232.
▲
by
RX14
10y ago
If you don't mind starting from scratch and using a statically typed language, crystal is amazing. However, you will not get vary far porting any large ruby project to crystal without a rewrite from scratch.
233.
▲
by
RX14
10y ago
It's LLVM's choice when it inlines, I'm sure it has some fancy heuristics.
234.
▲
by
RX14
10y ago
Most crystal programs make heavy use of inlining, at least from my experience profiling crystal programs, which removes the whole overhead entirely.
235.
▲
by
RX14
10y ago
Yeah, puts is part of the part of the standard library, and uses crystal's evented io framework, fiber scheduler and libevent. This is what most of the extra code in the asm output will be doing.
236.
▲
by
RX14
10y ago
If you're experimenting with asm in crystal, you might want to use --prelude=empty to remove the standard library to make the asm output cleaner. You can then then require lib_c and use that directly.
237.
▲
by
RX14
10y ago
Bear in mind that this isn't a release build, so the generated assembly will not be optimized at all.
238.
▲
by
RX14
10y ago
Intel essentially has a monopoly on the market for desktop cpus, which can't help.
239.
▲
by
RX14
10y ago
Seriously check out crystal. Go's goroutines seem to do quite well, and crystal is pretty close to go in terms of concurrency, but is a higher-level language overall.
240.
▲
by
RX14
10y ago
Fixes for many of the issues raised by this post have since made it into crystal master: https://github.com/crystal-lang/crystal/commit/7eb738f550818...
More ›