News for hackers. Stuff that matters.
Re:Lilith: x86-64 OS written in Crystal by onlyrealcuzzo on Sunday December 22, 2019 @09:02PM (#21860988)
Maybe it's just because I come from Ruby, but Crystal seems like an amazing language. I'm interested why it seems to be getting little attention compared to Go, Rust, & Julia. It seems in the same league to me.

Kotlin and Swift have more obvious reasons for their adoption.

Re:Lilith: x86-64 OS written in Crystal by burlesona on Sunday December 22, 2019 @11:25PM (#21861478)
I wouldn't say it's getting "little attention," rather it's relatively new (for a language) and not backed by a major player who can instantly give it a huge spotlight / platform.

For being a 5-year old indie language out of South America, I think it's doing quite well, and projects like this are good evidence of why.

Ruby is an outstandingly productive language. Copying the expressive syntax and ergonomics of Ruby into a fast, statically typed, compiled language with excellent C bindings is a very compelling idea.

Re:Lilith: x86-64 OS written in Crystal by squarefoot on Monday December 23, 2019 @09:55AM (#21863926)
"Ruby is an outstandingly productive language."

This. I recall ages ago when I had to write a networked tool and had lots of freedom in choosing tools and languages (and time), so I picked this new thing called Ruby just because it looked so easy to understand. That was years before Ruby On Rails was introduced, so the language was pretty much unknown. After some time to grasp the basics I started to be productive; making changes or adding functionality or debugging became really fast, and in the end I recall thinking "if only this thing was nearly fast as C that would be wonderful". I believe that just happened. OK, maybe not 100% identical to Ruby or 100% on par with C speed wise, but just being close to that is a huge achievement. I only wish it was available for small embedded ARM boards like other interesting languages like Nim etc. Last time I checked, Crystal is bootstrapped, ie it requires itself to compile itself, which IMO doesn't help portability to new iron.

Re:Lilith: x86-64 OS written in Crystal by sethrin on Monday December 23, 2019 @03:49PM (#21867239)
Crystal uses llvm, and should be able to cross-compile to platforms llvm supports, presumably not without some trouble.
Re:Lilith: x86-64 OS written in Crystal by auvi on Monday December 23, 2019 @08:08AM (#21863359)
Two other languages that I can think of that have their roots in South America are Lua and Elixir.
Re:Lilith: x86-64 OS written in Crystal by holtalanm on Monday December 23, 2019 @10:13AM (#21864058)
i've been a huge fan of elixir ever since i found it a few years ago. The main web framework (phoenix) is doing some really cool stuff right now with live-view, too, and I'm pretty darn excited about it.

I've always thought that the best system for a web server would be erlang OTP, because of the design based around uptime and system recovery. It has been proven in production by a few companies now in web dev, and erlang has been used for years by telecom companies for their own infrastructure.

elixir, imo, is awesome because of the ruby-like syntax, but I would probably be using erlang for my personal projects regardless because of what I mentioned earlier.

Re:Lilith: x86-64 OS written in Crystal by haliax on Monday December 23, 2019 @11:05AM (#21864524)
Isn't elixir just syntactic sugar on top of Erlang semantics?
Re:Lilith: x86-64 OS written in Crystal by dnautics on Monday December 23, 2019 @01:36PM (#21865886)
1) Yes.

2) No. It's sugar + opinions.

Elixir gives you a lot of 21st century development tools: Async Tasks, Compilation environment (dev vs prod vs test out of the box), first class documentation and first class test suite. Sure you could implement these in erlang, but in Elixir, it's opinionated and everyone is basically on board with the same set of tools.

Some of these tools are making their way back to erlang, like telemetry, and some aspects of docgen.

There are also some under the hood features, too. I can run async tests where the test is given an id, the database gets a sandbox with that id, I can escape the vm (via chromedriver, eg) passing the id, and when the request hits the http server component, it and all child tasks is aware of the test that it's in, so all of the database calls are routed to the correct sandbox, resulting in concurrent and idempotent end-to-end tests. Again, you could do this from top to bottom in erlang, but elixir has support for this out of the box, and the good anointed and 3rd party libraries (Mox, ecto, hound) use these elixir features.

It's pretty nice to be able to run a full suite of unit and E2E tests in about 10 seconds.

Re:Lilith: x86-64 OS written in Crystal by nlh on Sunday December 22, 2019 @09:21PM (#21861052)
I found Crystal about a year ago and absolutely fell in love with it. It just “clicks” for me.

My sense from reading most peanut-gallery commentary that the biggest reasons it hasn’t taken off more (yet) are:

1. Real multi-threading (it’s now in alpha - but previously just had single-threaded concurrency - and sorry I might be getting that terminology wrong).

2. Windows support (I personally don’t care but I haven’t found a single thread talking about Crystal where someone doesn’t chime in and complain about this)

I have a feeling once it reaches 1.0 and those issues are addressed it’ll get a bit more attention. It deserves it!

Re:Lilith: x86-64 OS written in Crystal by tomrod on Sunday December 22, 2019 @09:39PM (#21861118)
> Windows support

WSL support maybe?

Re:Lilith: x86-64 OS written in Crystal by dleslie on Sunday December 22, 2019 @10:14PM (#21861250)
That's like recommending Office via Wine in 2001.
Re:Lilith: x86-64 OS written in Crystal by S-E-P on Monday December 23, 2019 @12:04AM (#21861588)
Not in the slightest. WSL is capable for most things.

Wine in 2001 was not usable

Re:Lilith: x86-64 OS written in Crystal by unixhero on Monday December 23, 2019 @02:50AM (#21862105)
At that time I used it to play StarCraft and burn CDs with Nero Burning ROM, on Slackware. It was indeed usable!
Re:Lilith: x86-64 OS written in Crystal by hordeallergy on Monday December 23, 2019 @09:10AM (#21863664)
The problem with wsl is that its a window like a small island extending 1000m into the air, and the moment you step off... Splat, you're back in Windows with the registry and such. I bought a surface a few weeks back - wsl is nothing but an improved cygwin, of no use to Linux/Mac users, and windows has become repulsively spammy. I've installed arch.
Re:Lilith: x86-64 OS written in Crystal by Narishma on Monday December 23, 2019 @12:10AM (#21861610)
Can you use graphical applications with WSL?
Re:Lilith: x86-64 OS written in Crystal by Operyl on Monday December 23, 2019 @12:30AM (#21861690)
While I don’t recommend WSL for serious production workloads, yes you can X11 forward applications from WSL and there’s a few implementations that are really good, all things considered.
Re:Lilith: x86-64 OS written in Crystal by iotku on Monday December 23, 2019 @12:29AM (#21861679)
If you install an X server for Windows, yes.
Re:Lilith: x86-64 OS written in Crystal by ansible on Monday December 23, 2019 @12:56AM (#21861756)
I've purchased X410 for this. Since then I haven't looked to see if there are free implementations of an X server that work nicely with WSL.
Re:Lilith: x86-64 OS written in Crystal by jgtrosh on Monday December 23, 2019 @02:57AM (#21862140)
X servers pays along with WSL as well as with anything else. I've used Xming and VcXsrv with WSL without any problem specific to WSL.
Re:Lilith: x86-64 OS written in Crystal by pierreyoda on Monday December 23, 2019 @04:08AM (#21862357)
As said elsewhere, I've had excellent X11 experience with WSL2 at least thanks to the open-source VcXsrv.
Re:Lilith: x86-64 OS written in Crystal by anthk on Monday December 23, 2019 @05:33AM (#21862741)
Bullshit, I played DeusEx a few months later just fine.
Re:Lilith: x86-64 OS written in Crystal by radmuzom on Monday December 23, 2019 @06:58AM (#21863092)
[Off Topic] Deus Ex had a profound effect on me growing up, and probably shaped my views which last to this day. Unfortunately, very few games like that are made nowadays.
Re:Lilith: x86-64 OS written in Crystal by coldtea on Monday December 23, 2019 @08:58AM (#21863598)
Playing a specific game or 100 on it != a translation layer from one OS to another is ready or generally usable.

Games have minimal dependencies re OS APIs wise. Office apps and other programs make far more extensive use of OS facilities...

So hardly "bullshit".

Re:Lilith: x86-64 OS written in Crystal by yellowapple on Monday December 23, 2019 @05:22PM (#21868016)
> Games have minimal dependencies re OS APIs wise.

Sure, if you exclude "let's use every little quirk and undocumented feature in the graphics and audio and input stacks we can find because gotta go fast sanic noises".

Both games and office software (ab)use OS APIs; the difference is the specific subset of those APIs said programs (ab)use.

So yeah, you're right that it ain't "bullshit", but don't write off games as somehow "easy" compared to office programs; a substantial amount of effort has been poured into reimplementing Windows' multimedia stack in Wine and continues to be poured even now.

Re:Lilith: x86-64 OS written in Crystal by anthk on Wednesday December 25, 2019 @11:54PM (#21882093)
DirectX9 is not easy at all, it's almost Glide/Vulkan like low level-ish API. But hey. that's "bullshit". My balls. The above user should try running a pure DX9 game with Wine and GL 2.1 on a Intel Mobile 4 series with no noticeable frame drops. I tried. Hard.

But also, having DX7/8 being almost 100% compatible back in the day was a huge step on stability vs Windows 98, even if the RAM and CPU usage were higher. DX run fast, so did Max Payne.

Re:Lilith: x86-64 OS written in Crystal by PixyMisa on Monday December 23, 2019 @01:15AM (#21861807)
It works great under WSL, but as others note, it needs first-class Windows support to really take off.
Re:Lilith: x86-64 OS written in Crystal by rishav_sharan on Monday December 23, 2019 @03:34AM (#21862258)
Wsl is good for webdev. Not something that you will use in production. And certainly not for other usecases like gamedev
Re:Lilith: x86-64 OS written in Crystal by Narishma on Sunday December 22, 2019 @10:12PM (#21861242)
That's not good enough.
Re:Lilith: x86-64 OS written in Crystal by BubRoss on Monday December 23, 2019 @02:08AM (#21861977)
Lots of the crop of new languages with cleaner designs have huge problems with windows. V doesn't work on windows and zig's compiler fails if you use carriage return newlines. They even built in an error message for it instead of just making the parser work. It's kind of ridiculous how these languages shoot themselves in the foot.
Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @02:52AM (#21862121)
I think Zig is probably just being opinionated there; many of the new languages seem to be overly so. Last I checked, both the Zig and Nim compilers refused (on principle, not for any technical reason) to compile code containing tabs (among other things). I don't (usually) want my compiler to do linting, and I certainly don't want language authors to dictate my code style from on high.
Re:Lilith: x86-64 OS written in Crystal by kstenerud on Monday December 23, 2019 @03:54AM (#21862313)
Go is also annoying with its anal retentive source rules. I finally got so frustrated that I modified the compiler: https://github.com/kstenerud/go
Re:Lilith: x86-64 OS written in Crystal by ay on Monday December 23, 2019 @08:21AM (#21863414)
Thank you for this. The passive-aggressive style of erroring on unused variable while staying absolutely silent when I accidentally print the &int variable with %d format, always seemed like an inconsistency to me.
Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @04:14AM (#21862388)
It really is a sad state of affairs when disabling the linter requires patching the compiler. I wonder if any of the LLVM-based Go compilers will adopt a saner policy?
Re:Lilith: x86-64 OS written in Crystal by BubRoss on Monday December 23, 2019 @09:43AM (#21863854)
Making a compiler break with pretty much any file saved from a windows text editor is a very bold opinion, I can't say it would be my choice if I wanted to grow my user base.
Re:Lilith: x86-64 OS written in Crystal by meesles on Monday December 23, 2019 @07:18AM (#21863162)
What about Go? It seems like their approach is that if they define the style guide and build it into tooling, your code style (for Go) can only be the 'approved' style.

Or, put another way: People only have code styles because languages leave ambiguity. By removing that ambiguity you force your user-base to be consistent therefore increasing communication and productivity.

I tend to agree. It really grinds my gears when precious time is wasted on styling issues when there is no technical reason for either side. Granted it can be tough if you use three different languages with three different sets of rules.

Re:Lilith: x86-64 OS written in Crystal by ChrisSD on Monday December 23, 2019 @01:15PM (#21865658)
Rust has grappled with the issue of how far to push styling rules. E.g. from 2016:

https://github.com/rust-lang/rfcs/pull/1607#issuecomment-227...

I think it's worth reading more of that thread for some pros and cons of being very strict with styling rules. Note that being too strict can lead to code being less readable in specific edge cases. This may or may not be considered a fair trade off.

Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @06:27PM (#21868441)
To summarize the linked post (which I completely agree with), just provide officially recommended sane defaults and then get out of the user's way. In my view, that's how nearly all software ought to be written.
Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @06:12PM (#21868345)
It's a fundamentally flawed approach in my opinion; viewing the users of a language as a single unified user base is a mistake. Various projects and groups will inevitably have vastly different use cases, and thus needs and considerations.

For example, I liberally mix C, C++, D, and occasionally other languages within a single code base on my personal projects. For sanity, I choose to observe my own consistent style across all languages when doing so. This obviously doesn't match common practice for any of the languages in question, but thankfully none of them attempt to impose the opinions of their designers on me.

I view languages being concerned with code formatting as a form of scope creep. A language should facilitate good code and communication by thoughtfully designing the syntax and providing useful constructs to the programmer. That's already an incredibly difficult problem - trying to tackle additional interpersonal or organizational issues is far too much, can't possibly accommodate everyone, and is bound to have unexpected negative consequences.

Put another way, core infrastructure should nearly always be as unopinionated as possible. Stick to as narrow a design goal as is reasonably possible and execute on it as well as possible. For a language, that means faithfully translating whatever I throw at it into machine code unless there is a legitimate technical barrier in the way of doing so.

> It really grinds my gears when precious time is wasted on styling issues when there is no technical reason for either side.

If this is happening it's indicative of an organizational or managerial problem. Any given project should have a clearly defined (and consistently enforced) code style, ranging from "use gofmt" to "follow PEP 8" to "adhere to our internal style guide".

Re:Lilith: x86-64 OS written in Crystal by naasking on Monday December 23, 2019 @09:42AM (#21863848)
> I don't (usually) want my compiler to do linting, and I certainly don't want language authors to dictate my code style from on high.

Enforced code style consistency has considerable advantages. "Linting" probably shouldn't be a thing.

Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @06:13PM (#21868348)
Across a specific project, team, or org, sure. That's what style guides, formatters, linters, and pre-commit hooks are for. The core language is the wrong level of abstraction for this stuff.
Re:Lilith: x86-64 OS written in Crystal by naasking on Tuesday December 24, 2019 @10:57AM (#21872820)
Yeah, I still disagree. There's considerable value in being sure that you'll see the same code structure everywhere.
Re:Lilith: x86-64 OS written in Crystal by sullyj3 on Monday December 23, 2019 @03:50AM (#21862305)
Presumably they're following python's example here.
Re:Lilith: x86-64 OS written in Crystal by Reelin on Monday December 23, 2019 @04:01AM (#21862335)
Python works just fine with tabs, but the language-endorsed style guide (PEP 8) recommends against them. (However, the usual plugin for Vim requires adding "let g:python_recommended_style = 0" to work correctly.)
Re:Lilith: x86-64 OS written in Crystal by sullyj3 on Tuesday December 24, 2019 @10:17AM (#21872552)
I must've misremembered, possibly what's disallowed is mixing tabs and spaces.
Re:Lilith: x86-64 OS written in Crystal by PedroBatista on Monday December 23, 2019 @05:26AM (#21862707)
Well, good for them wanting to die on that hill.

They will remain dead..

Re:Lilith: x86-64 OS written in Crystal by yellowapple on Monday December 23, 2019 @05:10PM (#21867929)
"zig fmt" ostensibly cleans up carriage returns and tabs, for what it's worth.

Granted, I agree that it's silly that Zig's compiler can't just "do what I mean" and just accept that there will be tabs and carriage returns.

However, I'd say programming languages in general always seem to have trouble with Windows at first, in particular because Windows is pretty alien to those more accustomed to Unix-like environments (which, I reckon, is where most people making new programming languages are actually making said programming languages).

Crystal still doesn't have full Windows support, either, on that note (you can cross-compile a "Hello World" program, but there's a lot of pretty critical stuff missing).

Re:Lilith: x86-64 OS written in Crystal by pjmlp on Monday December 23, 2019 @07:46AM (#21863280)
Indeed, and if they do it via cygwin, MinGW, or even WSL, that is no way to win the hearts of Windows developers.
Re:Lilith: x86-64 OS written in Crystal by saagarjha on Monday December 23, 2019 @03:11AM (#21862185)
V has other, bigger issues :/
Re:Lilith: x86-64 OS written in Crystal by kaikki on Monday December 23, 2019 @03:35AM (#21862261)
What are some? I wrote a small ascii snake game with it and found it generally OK.
Re:Lilith: x86-64 OS written in Crystal by saagarjha on Monday December 23, 2019 @03:52AM (#21862310)
It’s been somewhat overhyped by the author.
Re:Lilith: x86-64 OS written in Crystal by nedp on Tuesday December 24, 2019 @04:33AM (#21870905)
Can you give us examples where Alex "overhyped" the language? So far most of the promises he made have been fulfilled / currently work-in-progress.
Re:Lilith: x86-64 OS written in Crystal by todotask on Monday December 23, 2019 @04:37AM (#21862503)
I wrote a benchmark for V too and it’s fast but there are other issues internally and externally.

Have anyone know who is Alex?

He going to build compiler in AST, but as long as it’s useful for your works. It’s too early to tell whether it’s reliable for businesses, I’m more likely to trust Go as we know it’s battle tested.

It will definitely take more years to stabilise and promoting, other languages would have been mature and established.

Re:Lilith: x86-64 OS written in Crystal by tstusr20190823 on Monday December 23, 2019 @03:23AM (#21862230)
V have first-class Windows support, what is your problem?
Re:Lilith: x86-64 OS written in Crystal by BubRoss on Monday December 23, 2019 @09:40AM (#21863829)
My problem is that it doesn't actually work on windows. Get the latest build, run it with no arguments, get a large error instead of the REPL.
Re:Lilith: x86-64 OS written in Crystal by tstusr20190823 on Tuesday December 24, 2019 @03:04AM (#21870630)
What is "latest build"? V does not release any stable build and you can get "large error" on any platform right now when trying random "latest build" without any effort to investigate the issue.
Re:Lilith: x86-64 OS written in Crystal by BubRoss on Tuesday December 24, 2019 @08:32AM (#21871906)
The landing page has big links for executables for Mac, Linux and Windows - the windows build is completely broken.
Re:Lilith: x86-64 OS written in Crystal by faissaloo on Monday December 23, 2019 @03:15AM (#21862199)
Does anyone actually care about Windows support?
Re:Lilith: x86-64 OS written in Crystal by zerkten on Monday December 23, 2019 @10:33AM (#21864207)
The StackOverflow 2019 survey suggests 47% of developers are on Windows (https://insights.stackoverflow.com/survey/2019#technology-_-...). This is a big chunk of developers you can't reach well, if you are limited to Linux and/or macOS. Windows devs might desire to have Crystal because they want to build native apps, but the reality is many people use the OS for other reasons that are beyond their control.

I don't find it surprising to see this question in a discussion involving a language related to Ruby. It's a bit sad it still comes up, but there is overwhelming demand for better Windows support of this and any other good or promising software running on Linux or macOS.

Historically, Python has had reasonable Windows support. It got to a point where it was OK and stopped improving. In recent years there has been more attention and improvements. This investment has meant that the language is reasonably viable for a lot of tasks on Windows. This doesn't mean that there hasn't been an influx of folks at points with little knowledge or care for Windows, but lots of packages work reasonably well.

Ruby is a different story. Rails was the big growth driver and there was a narrow focus. The pattern emerged of dev on macOS and deployment on Linux. I personally credit the tropes about only seeing Macs at dev conferences in a big way to Rails. The result is that it's infeasible to use Windows directly and you are best to go with a VM, or now WSL 2.0. It didn't have to be this way when a big chunk of developers are Windows. Rails could have taken an even bigger chunk of the market if Ruby had better Windows support.

Strategically, Crystal and other languages that want real adoption and the things that go with that (more recognition, more libraries, more real world use, more contributors, etc.) need to work out a good plan for Windows support.

Re:Lilith: x86-64 OS written in Crystal by olah_1 on Monday December 23, 2019 @09:04AM (#21863630)
I have had a huge amount of issues trying to use both Ruby and Rust on Windows for server / client use cases. It's not just that it "works" on Windows, but that it works easily out of the box for common use cases.

Meanwhile Python and Golang work great on Windows with no extra effort. It's like night and day.

Re:Lilith: x86-64 OS written in Crystal by steveklabnik on Monday December 23, 2019 @10:23AM (#21864124)
What issues did you have with Rust? I use Rust on Windows every day.
Re:Lilith: x86-64 OS written in Crystal by olah_1 on Monday December 23, 2019 @11:36PM (#21869899)
It's been a while, but it was the common issue with certs that Ruby on Windows also has. I just couldn't get it sorted for whatever reason. Maybe it's not an issue anymore though? Rust http client works OOTB on Windows?
Re:Lilith: x86-64 OS written in Crystal by steveklabnik on Tuesday December 24, 2019 @12:56PM (#21873695)
I have not had any cert issues, but I also have a pretty normal network. Maybe it’s better now!
Re:Lilith: x86-64 OS written in Crystal by cpach on Monday December 23, 2019 @06:47AM (#21863045)
Well, I guess devs on Windows do.

Windows support means less friction for people who wants to try it out.

Re:Lilith: x86-64 OS written in Crystal by AnIdiotOnTheNet on Monday December 23, 2019 @09:09AM (#21863657)
You are aware that Windows thoroughly dominates the Desktop computing space right?
Re:Lilith: x86-64 OS written in Crystal by faissaloo on Monday December 23, 2019 @10:45AM (#21864302)
Sure but from a developer's perspective I've never found it compelling
Re:Lilith: x86-64 OS written in Crystal by AnIdiotOnTheNet on Monday December 23, 2019 @10:56AM (#21864412)
So therefore it must not be to anyone else right?

Is this some kind of variation on Works for Me(tm)?

Re:Lilith: x86-64 OS written in Crystal by rishav_sharan on Monday December 23, 2019 @03:32AM (#21862252)
A lot of us who actually use Crystal do. Its still the most asked for feature in the language
Re:Lilith: x86-64 OS written in Crystal by Jenz on Monday December 23, 2019 @07:49AM (#21863287)
I never thought there would come a time when I would want windows-support. However, the case is, that Windows as it is today, is quite inevitable. Hence if you want Crystal, you probably want Windows support.
Re:Lilith: x86-64 OS written in Crystal by ksec on Tuesday December 24, 2019 @02:43PM (#21874415)
That was the biggest problem for anyone jumping on to Ruby Rails in regions that has little to Zero Mac market shares and all Windows PC. With WSL2 this was (?) solved, but that is assuming everyone is on Windows 10 and latest version.

This has been hurting RoR adoption for long, although at this point it probably no longer matters.

Re:Lilith: x86-64 OS written in Crystal by 7thaccount on Monday December 23, 2019 @09:15AM (#21863691)
Yes. Although I'd rather use Linux, most company IT will distribute windows computers and will not give you a Linux laptop. That means a lot of your work will be done on Windows.
Re:Lilith: x86-64 OS written in Crystal by fluffything on Monday December 23, 2019 @08:28AM (#21863450)
> I'm interested why it seems to be getting little attention compared to Go, Rust, & Julia.

Rust essentially competes with C and C++ (and maybe D and Nim without their GCs), and the reason it gets hype is because it brings some unique features for that niche.

Go brought some unique features as well (goroutines done right), and it is pushed by a major player.

In Julia's niche, you only really have Julia and Fortran - sure there are many other languages used in that niche, but there are very very few languages exclusively designed for that niche.

C#, Kotlin and Swift are the system API languages of major platforms (MS, Apple, Android). Javascript is the language for the web.

What's Crystal for?

Re:Lilith: x86-64 OS written in Crystal by gdxhyrd on Monday December 23, 2019 @08:58AM (#21863596)
> C#, Kotlin and Swift are the system API languages of major platforms (MS, Apple, Android).

No, the system API of those systems is exposed in C, ObjC and C respectively.

You may be thinking about the most common language in those platforms nowadays (and their respective APIs).

Re:Lilith: x86-64 OS written in Crystal by fluffything on Friday January 03, 2020 @09:28AM (#21946115)
> No, the system API of those systems is exposed in C, ObjC and C respectively.

This is incorrect. Microsoft doesn't have a C compiler, only a C++ compiler, so the lower level language on Windows is C++. Yet for application development, the application language is C#.

On Apple, the lowest level language is ObjC, and the application language is Swift. And on Android, its C + Kotlin.

Doing application development on, e.g., Android, using the C NDK, is pretty much unsupported, since the NDK is mostly undocumented, and changes often. The only stable API for application development is Java, or Kotlin.

Re:Lilith: x86-64 OS written in Crystal by LessDmesg on Monday December 23, 2019 @09:11AM (#21863671)
It's still C all the way down, even in 2019. Amazing how far crappy, badly thought out, ubiquitous, low entry barrier languages can go. More than 40 years of memory errors, out of bounds errors, broken metaprogramming, undefined behavior, lack of error handling, type safety, abstractions and intelligent design in general, all served under the clunky syntax sauce. And it still powers our world. Worse is better, indeed.
Re:Lilith: x86-64 OS written in Crystal by gdxhyrd on Monday December 23, 2019 @02:38PM (#21866576)
> crappy, badly thought out, ubiquitous, low entry barrier languages

It is easy to criticize designs that are 47 years old in today's context.

I am betting you wouldn't have done a better job half a century ago either.

Re:Lilith: x86-64 OS written in Crystal by dleslie on Monday December 23, 2019 @10:07AM (#21864006)
Crystal _could be_ for game developers; there's large green pastures left almost entirely untouched for a language to disrupt it. You see a few niche languages make inroads, like Haxe, but I expect something could really effect change.

The key is to be as fast as possible, as memory light as possible, and able to produce and speak to C ABI.

Re:Lilith: x86-64 OS written in Crystal by s_y_n_t_a_x on Monday December 23, 2019 @10:25AM (#21864146)
Nim and Lua are in that pasture. Being fast, memory light, and the C interop are the key features of Lua.
Re:Lilith: x86-64 OS written in Crystal by dleslie on Monday December 23, 2019 @11:19AM (#21864638)
Lua yes, and since the 90s, but Nim? I've not seen that yet. What games use it?
Re:Lilith: x86-64 OS written in Crystal by s_y_n_t_a_x on Monday December 23, 2019 @11:31AM (#21864730)
There's integration in Unreal Engine for Nim.

I'm not saying it's widespread, but the language features put it in that field.

Re:Lilith: x86-64 OS written in Crystal by _pmf_ on Monday December 23, 2019 @12:06PM (#21865049)
Jon Blow's (developer of "The Witness") Jai is worth mentioning in that context (not released, though).
Re:Lilith: x86-64 OS written in Crystal by mapcars on Monday December 23, 2019 @09:08AM (#21863646)
>Go brought some unique features as well (goroutines done right),

Why Erlang processes are not right?

Re:Lilith: x86-64 OS written in Crystal by elchupanebre on Monday December 23, 2019 @09:16AM (#21863693)
Erlang is just too different from the C-like languages that everyone is accustomed to.
Re:Lilith: x86-64 OS written in Crystal by jcadam on Monday December 23, 2019 @07:45AM (#21863275)
Well, I hadn't heard about Crystal until... just now. So projects like this are great marketing.

I'm reading up on it and liking what I'm seeing so far. This could be a great Golang (which I detest) replacement for me when I need to write a small, native program. Also, the Ruby-esque syntax is a win. I've always thought Ruby was a nicer language than Python. Too bad Ruby never grew much of a dev community outside of Rails.

Re:Lilith: x86-64 OS written in Crystal by mintplant on Monday December 23, 2019 @12:51AM (#21861739)
Didn't Crystal run into a major development roadblock a couple(?) years ago? Something about a fatal design flaw in the type system which led to exponential blowup in larger programs. I haven't been able to surface the relevant GitHub threads again, but whatever it was, I guess they worked past it eventually.
Re:Lilith: x86-64 OS written in Crystal by orthoxerox on Monday December 23, 2019 @01:27AM (#21861848)
Yew, they tried to do whole-program type inference a la ML. That was a long time ago, modern Crystal has you indicate parameter and return types.
Re:Lilith: x86-64 OS written in Crystal by ezrast on Monday December 23, 2019 @02:31PM (#21866502)
All that stuff is still optional. I don't think there are any cases where removing type annotations from a working Crystal program will change behavior.
Re:Lilith: x86-64 OS written in Crystal by asymmetric on Monday December 23, 2019 @09:30AM (#21863764)
Do you have a link?
Re:Lilith: x86-64 OS written in Crystal by ezrast on Monday December 23, 2019 @02:54PM (#21866721)
You're probably describing this or a related issue: https://github.com/crystal-lang/crystal/pull/6351

I don't think it was ever a major roadblock. The fix isn't pretty but it doesn't come up that often in practice.

Re:Lilith: x86-64 OS written in Crystal by dleslie on Sunday December 22, 2019 @10:13PM (#21861245)
It lacks first-class Windows support.

That's it. That's why it fails to gain the traction it deserves.

Re:Lilith: x86-64 OS written in Crystal by giancarlostoro on Sunday December 22, 2019 @10:15PM (#21861253)
That never stopped the Go community from porting Go to Windows. It was never ported by core maintainers, but by Go developers themselves.
Re:Lilith: x86-64 OS written in Crystal by pjmlp on Monday December 23, 2019 @12:54AM (#21861746)
Go still lacks Windows support for certain features, e.g. plugins.

And wanting to be part of Google team helped many community contributions. Easy to compare with how much community contributions were made to Inferno and Limbo.

Re:Lilith: x86-64 OS written in Crystal by giancarlostoro on Monday December 23, 2019 @07:45AM (#21863270)
Fair, I had forgotten about plugins. On the other hand plugins has other nuances[0]. Plugins don't seem like a properly release feature due to its constraints.

[0]: https://www.reddit.com/r/golang/comments/b6h8qq/is_anyone_ac...

Re:Lilith: x86-64 OS written in Crystal by dleslie on Sunday December 22, 2019 @10:19PM (#21861268)
And yet it was ported, and has OK support. Crystal on Windows is a non-starter right now.
Re:Lilith: x86-64 OS written in Crystal by giancarlostoro on Monday December 23, 2019 @07:46AM (#21863281)
> OK support

I havent had issues with Go on Windows or any OS, is there something broken about Go in Windows?

Re:Lilith: x86-64 OS written in Crystal by wilandbo on Monday December 23, 2019 @01:29AM (#21861850)
Have been playing with Crystal for several months and still find it amazing what this language can deliver given that it's still relatively new.

Asked my friends to try it out and they love it too. Hopefully we can grow a bigger ecosystem for Crystal to make it a main stream programming language one day.

Re:Lilith: x86-64 OS written in Crystal by lmm on Sunday December 22, 2019 @09:04PM (#21861001)
What's Crystal's unique selling point? It's older than Rust, Kotlin, Swift, Nim, or even OCaml, and doesn't really offer anything they don't. More Ruby-like syntax? Fine, but most people don't particularly like Ruby syntax.
Re:Lilith: x86-64 OS written in Crystal by shakna on Sunday December 22, 2019 @09:14PM (#21861032)
> It's older than Rust, Kotlin, Swift, Nim, or even OCaml, and doesn't really offer anything they don't.

Crystal is only five years old.

Nim is 11, Rust is 9, Kotlin is 8, OCaml is 23 and Swift is 5.

Basically, Crystal is tied with Swift as the youngest.

What it offers right now is a simple porting process for those with Ruby codebases.

Re:Lilith: x86-64 OS written in Crystal by k__ on Sunday December 22, 2019 @09:32PM (#21861084)
I think they meant younger.

But, yeah, besides the syntax familiarity for Ruby programmers it doesn't seem offer much that the others do.

Re:Lilith: x86-64 OS written in Crystal by shakna on Monday December 23, 2019 @11:03AM (#21864494)
> I think they meant younger.

The "even OCaml" is what threw me. Still not quite sure if they meant older or younger from it.

> But, yeah, besides the syntax familiarity for Ruby programmers it doesn't seem offer much that the others do.

A familiar syntax is a huge benefit in a lot of contexts. There's plenty of Ruby-only shops around the world. Making a faster and statically-typed language accessible to them is a decent niche.

Crystal isn't quite Ruby. It has type guarantees that Ruby doesn't, which makes it easier to maintain. The async and parallel stories are also immensely better in Crystal than Ruby.

The "Nil is a compile-time error" is also a feature I highly appreciate.

Re:Lilith: x86-64 OS written in Crystal by nine_k on Sunday December 22, 2019 @11:36PM (#21861500)
Okay, port your existing Ruby code to a compiled language, giving it multiple times the speed? Maybe three is a slight business opportunity here.

Also, give your developers a more productive language that can go where Ruby can't (like OS development), which is 90% instantly recognizable — may also be worth something?

Re:Lilith: x86-64 OS written in Crystal by lmm on Sunday December 22, 2019 @11:43PM (#21861523)
Is it really so hard to port Ruby code to any of the languages I mentioned? Even with Crystal you will still have to make changes to your code, is having to use a slightly different syntax such a big difference? If you've got Ruby code and you haven't already ported it, how badly do you need the speed?
Re:Lilith: x86-64 OS written in Crystal by EamonnMR on Monday December 23, 2019 @07:51AM (#21863291)
Mentally context switching between Ruby and any other language to do the translation actually is kind of a hassle.
Re:Lilith: x86-64 OS written in Crystal by k__ on Monday December 23, 2019 @08:16AM (#21863389)
I could imagine, that the subtle differences could get you ugly problems while porting.
Re:Lilith: x86-64 OS written in Crystal by lmm on Tuesday December 24, 2019 @01:08AM (#21870222)
Won't the differences be more subtle and difficult if you use a language that's syntactically Ruby-like but not actually Ruby?
Re:Lilith: x86-64 OS written in Crystal by rvz on Monday December 23, 2019 @03:49AM (#21862304)
Well it seems most developers here would rather use Ruby + several memory-optimised VM clusters to make their services go faster and destroy their balance sheet than to use a faster language that is efficient in memory and is also blazing fast.

A rewrite in (other fast language) from Ruby sounds ridiculous as soon as you include writing a extra FFI wrapper around this you have to maintain so that would be out of the picture and that sounds a lot harder than a semi 1:1 port of the source code.

The trouble is Ruby itself is starting to become a sunken cost as a language but is survived because of Rails, thus also explains the countless memory issues that happen when developers use it. So for a stopgap to something sort of better, I would rather port to Crystal or Elixir so I can run on those low-cost VMs and save cash.

Re:Lilith: x86-64 OS written in Crystal by PixyMisa on Monday December 23, 2019 @07:25AM (#21863193)
Slightly different?
Re:Lilith: x86-64 OS written in Crystal by k__ on Monday December 23, 2019 @08:20AM (#21863409)
I understood that Crystal is a huge thing for Ruby devs.

I just want to know if it is more than that or not.

I'm not a fan of Ruby and would prefer Nim or Rust if it were about syntax.

I ask myself if I miss any huge speciality of Crystal if I dismiss it just because of its syntax.

Re:Lilith: x86-64 OS written in Crystal by rishav_sharan on Monday December 23, 2019 @03:36AM (#21862266)
I am subscribed to the windows support github issue since 2013, so Crystal is definitely older than 5 years. I think its around 7 years old
Re:Lilith: x86-64 OS written in Crystal by shakna on Monday December 23, 2019 @05:32AM (#21862737)
The first release, 0.1.0, was in 2014. [0]

[0] https://crystal-lang.org/2014/06/19/crystal-0.1.0-released.h...

Re:Lilith: x86-64 OS written in Crystal by rishav_sharan on Tuesday December 24, 2019 @05:01AM (#21870982)
First official release maybe. But folks have been using Crystal since before that. This is the Github issue in question; https://github.com/crystal-lang/crystal/issues/26
Re:Lilith: x86-64 OS written in Crystal by shakna on Tuesday December 24, 2019 @05:23AM (#21871047)
Not arguing with it. However, choosing a point in time to check a language's age from is somewhat arbitrary, and first release seemed good enough.

The main point was comparative age of languages. Like OCaml which is more than two decades old compared to Crystal which is young.

Re:Lilith: x86-64 OS written in Crystal by steveklabnik on Monday December 23, 2019 @10:24AM (#21864135)
Rust is more like 4 than 9; 2015 was the initial stable release, most people couldn’t really use it for things before that.
Re:Lilith: x86-64 OS written in Crystal by icelend on Monday December 23, 2019 @11:48AM (#21864884)
Well, ok, so Crystal is 0 years old.
Re:Lilith: x86-64 OS written in Crystal by steveklabnik on Monday December 23, 2019 @01:28PM (#21865797)
Yep, I’d agree with that!
Re:Lilith: x86-64 OS written in Crystal by nlh on Sunday December 22, 2019 @09:16PM (#21861042)
C bindings, strongly-typed, a great concurrency model, very fast, and Ruby-like syntax. That makes it a very unique and appealing language to me (and others).

If you / most people don’t particularly like the Ruby-like syntax, then Crystal might not appeal to you. But I can assure you to those of us who like the syntax, the language is wonderful and super fun to work with.

Re:Lilith: x86-64 OS written in Crystal by dragonwriter on Monday December 23, 2019 @12:12AM (#21861622)
> C bindings, strongly-typed, a great concurrency model, very fast, and Ruby-like syntax.

Ruby’s syntax is a great fit for Ruby’s semantics but—and Ruby is my personal favorite language—I don't see much point for it divorced from that. It's the one thing I like least about Elixir.

OTOH, Crystal looks like it may be close enough to Ruby semantics that Rubyish syntax is a plus rather than a misdirection and distraction.

Re:Lilith: x86-64 OS written in Crystal by cosarara on Monday December 23, 2019 @07:45AM (#21863269)
In what way is Elixir's syntax like Ruby's? It has "end" on blocks and string interpolation with "#{whatever}", but everything else is different. It's about as close to Ruby as Ruby is to Python (which is to say, not much).
Re:Lilith: x86-64 OS written in Crystal by onlyrealcuzzo on Monday December 23, 2019 @02:13PM (#21866310)
I think it really helps that you can write mostly functional code in Ruby by just chaining higher-order array functions, and you can use Pipes in Elixir to do this almost identically -- when you consider the fact that all the higher-order array functions have identical or very similar names and parameters in the two languages.

My Ruby code is like 95% chained higher-order array functions. My classes almost never have state. I'm basically writing functional code, and it seems like this is a pretty common paradigm in Ruby. I will say this was HEAVILY influenced by learning Elixir.

When not taking external libraries into account, my Elixir code (at least to me) seems almost identical to my Ruby code.

I think Python and Ruby are very close. But I personally think list comprehensions are un-intuitive and you can't easily chain higher-order array functions in Python.

So although I feel the spirit of my Ruby and Python code is identical, in no way do they look and feel identical. In the same way, I think my Elixir and Python are quite different.

Sample size of 1. I know. Just thought I'd share.

Re:Lilith: x86-64 OS written in Crystal by cosarara on Monday December 23, 2019 @02:39PM (#21866580)
Thanks for sharing! I think though that what you are referring to is not syntax but semantics. On both places you are chaining HO array functions, so the algorithm is pretty much the same, but the syntax you use is different in both places (pipes, dot).
Re:Lilith: x86-64 OS written in Crystal by pseudalopex on Tuesday December 24, 2019 @06:14AM (#21871245)
Python's ist comprehensions are just set builder notation with English keywords.
Re:Lilith: x86-64 OS written in Crystal by yellowapple on Monday December 23, 2019 @05:48PM (#21868183)
Having done lots of development in both Ruby and Elixir (both professionally and on my free time), I'd say the only substantial differences boil down to the following:

- Elixir has |> instead of method chaining

- Elixir uses "do [...] end" consistently for blocks (as opposed to Ruby omitting the "do" in front of function/module/class/etc. bodies)

- Elixir supports Erlang-style tuples on a syntax level while Ruby (AFAICT) does not

- Elixir supports Erlang-style pattern matching / destructuring while Ruby (last I checked) does not

- Elixir's a fair bit stricter about differentiating zero-argument function calls from variables (i.e. if it's ambiguous it'll complain)

That is to say, Elixir's syntax descends directly from Erlang and Ruby, just as Ruby's syntax descends directly from Eiffel and Perl, and it shows rather strongly. That should be unsurprising, given that Elixir is the creation of a (former?) Rails maintainer.

Re:Lilith: x86-64 OS written in Crystal by lmm on Sunday December 22, 2019 @11:37PM (#21861504)
> C bindings, strongly-typed, a great concurrency model, very fast

My point is that all this is normal, and all the languages I list have offered it for longer than Crystal.

Re:Lilith: x86-64 OS written in Crystal by jbverschoor on Monday December 23, 2019 @04:32AM (#21862474)
LLVM based, and in terms of performance, it's one of the fastests
Re:Lilith: x86-64 OS written in Crystal by viraptor on Monday December 23, 2019 @02:21AM (#21862014)
Kotlin - it's on JVM which is a good thing for some and a bad thing for others. It's easier to distribute standalone crystal binary for example.

Swift - crystal throws exceptions, swift explodes...

Ocaml - the functional approach is not for everyone.

Rust - I like rust a lot. But sometimes I want to write something quick and I'm happy to sacrifice some memory and speed to not have to deal with the ownership issues.

Nim - the most comparable, I guess it's syntax preference at that point

Re:Lilith: x86-64 OS written in Crystal by ernst_klim on Monday December 23, 2019 @03:57AM (#21862324)
> Ocaml - the functional approach is not for everyone.

OCaml is pretty general purpose though, it has loops, objects, mutable state. libguestfs [1] and some other codebases (the compiler itself, btw) are written in a pretty imperative OCaml.

[1] https://github.com/libguestfs/libguestfs

Re:Lilith: x86-64 OS written in Crystal by Jenz on Monday December 23, 2019 @07:33AM (#21863222)
OCaml somewhat tries to be familiar for OOPs, but it _is_ first and foremost a functional language.

Personally, I am learning it now, and I think rather than it being a stepping stone between OOP and FP, it might as well be its own separate and hybrid paragdim; I find purer FP languages like Haskell much more intuitive than the mix of modules, objects, types and classes of OCaml.

Though do not get me wrong, OCaml is an amazing language. It just stands rather by itself.

Pardon my terrible english.

Re:Lilith: x86-64 OS written in Crystal by imhoguy on Monday December 23, 2019 @03:08AM (#21862174)
You can use Kotlin/Native [0] or just plain Kotlin over Java with GraalVM which produces compact binaries.

[0] https://kotlinlang.org/docs/reference/native-overview.html

Re:Lilith: x86-64 OS written in Crystal by vips7L on Monday December 23, 2019 @08:20AM (#21863408)
Kotlin/native's stdlib isn't feature complete. You have to use raw syscalls to do anything.
Re:Lilith: x86-64 OS written in Crystal by PixyMisa on Monday December 23, 2019 @07:24AM (#21863188)
Unique? There are a hell of a lot of computer languages out there. The only unique ones are those that are so bad that no-one ever did that again.

The selling point for Crystal is that it has a clean syntax that's easy for Ruby or Python developers to pick up (almost the same as Ruby), but compiles to standalone binaries that run really, really fast.

I mostly work in Python because the libraries are a lot more mature, but I use Crystal when I need to produce a standalone binary.

Re:Lilith: x86-64 OS written in Crystal by Shorel on Monday December 23, 2019 @05:31PM (#21868080)
> but compiles to standalone binaries that run really, really fast.

In a world with Go, Rust, D, C++ and C, this part requires comparison with these other languages.

Faster than Ruby and faster than Python doesn't cut it.

Re:Lilith: x86-64 OS written in Crystal by dom96 on Monday December 23, 2019 @09:42AM (#21863850)
Have you given Nim a try, as a Python developer it seems like it would be right up your alley.
Re:Lilith: x86-64 OS written in Crystal by disc on Sunday December 22, 2019 @11:32PM (#21861483)
It's possible that some (many?) programmers enjoy a Ruby-like syntax?
Re:Lilith: x86-64 OS written in Crystal by RX14 on Monday December 23, 2019 @08:50AM (#21863555)
It's unique selling point is union types as a part of the type system, with whole-program type inference and flow typing. This has never been done before (as far as I am aware), and it is incredibly powerful and interesting. It's compile-time duck typing.
Re:Lilith: x86-64 OS written in Crystal by mapcars on Monday December 23, 2019 @09:13AM (#21863676)
>whole-program type inference and flow typing

What do these mean?

Re:Lilith: x86-64 OS written in Crystal by loktarogar on Sunday December 22, 2019 @09:37PM (#21861112)
Ruby's syntax is a huge draw for many people.
Re:Lilith: x86-64 OS written in Crystal by Symmetry on Monday December 23, 2019 @08:20AM (#21863402)
I'm not familiar with all those langauges but I found the inference of union types pretty impressive.

foo = ENV["FOO"]? || 10

Re:Lilith: x86-64 OS written in Crystal by c-cube on Tuesday December 24, 2019 @07:38AM (#21871609)
It's very expressive and pleasant (and I never used ruby), while being fast and statically typed. That's a great combination of features. If it were stable, it'd be a serious contender to Go imho.
Re:Lilith: x86-64 OS written in Crystal by unixhero on Monday December 23, 2019 @02:51AM (#21862118)
It's for Ruby's developer friendly syntax. That's a huge selling point!
[dead]
Re:Lilith: x86-64 OS written in Crystal by klyrs on Sunday December 22, 2019 @09:28PM (#21861069)
I'm not smitten with the rust fandom either, but at least do your homework

https://www.redox-os.org/

Re:Lilith: x86-64 OS written in Crystal by todotask on Monday December 23, 2019 @10:02AM (#21863964)
>I'm interested why it seems to be getting little attention compared to Go, Rust, & Julia

I've noticed the slogan was change to "A language for humans and computers", what it really mean? Related to machine learning?

My impression that other than it was design to be as friendly as Ruby and fast as C. It's a lot helpful to have an FAQ if the Crystal team could provides.

Re:Lilith: x86-64 OS written in Crystal by coldtea on Monday December 23, 2019 @08:51AM (#21863558)
>I'm interested why it seems to be getting little attention compared to Go, Rust, & Julia

As I see it, Go gets 70% of the attention, Rust 25% and Julia 5%. Crystal which doesn't have major backing (no Google, no Mozilla, and Julia has some MIT hackers behind it IIRC, plus the whole "data science" angle which is fashionable today), gets even less.