News for hackers. Stuff that matters.
Re:The Witness: the creator of Braid talks about his fiendis... by hacker_9 on Thursday September 17, 2015 @04:54PM (#10235999)
See here for a write up up Jai's language features: https://sites.google.com/site/jailanguageprimer/

John is clearly coming in from a C++ mindset and is essentially fixing problems with the language that should have been really been fixed long ago. I think it looks interesting, but I'm not sure it really solves any big problems? Just seems to be a bit better syntax.

Re:The Witness: the creator of Braid talks about his fiendis... by greggman on Thursday September 17, 2015 @05:49PM (#10236288)
It's not just a better syntax for C++. If nothing else being able to use the entire language at compile time is a huge step in the right direction IMO.

C++ meta programming IMO was never meant for meta programming. It was intended do to a few simple template things, then someone discovered if you made an array of size [-1] you could basically turn it into a turing complete language. But, the contortions you have to go through are ridiculous. It's like writing photoshop in bash script. I'm surprised someone hasn't written an LLVM pick your language to C++ meta programming compiler just to not have to deal with that crap.

Sure that feature has been around in other languages for decades (lisp) but it's sorely missing from C++. People usually work around it by writing code generators, almost always in other languages.

There were other interesting ideas like using the closure specifiers to enforce function purity including all functions they call. I haven't followed whether that has worked out or not.

On top of that syntax matters. As JBlow pointed out, every time he has to waste time refactoring 50 lines of code for something that should be a 1 character change or spelling things out the compiler should be able to figure out is a huge drag on productivity and motivation.

That was my #1 take away from the videos I watched. How about designing a language for programmer joy. Most languages pick something else (multi-processing, memory safety, ...) but whether or not it will actually be pleasant and fun to program in is rarely considered.

Sure some people get off on solving the puzzles of contorting their language of choice to do something difficult. Especially C++ meta programming gurus. Others of us just want to get shit done. It's not writing the code that's fun for us. It's the result. The faster we can get there the more we can work on polishing and iterating.

Re:The Witness: the creator of Braid talks about his fiendis... by hyperion2010 on Thursday September 17, 2015 @06:19PM (#10236433)
I watched all his videos and my main take away was that there is actually no high level language besides C (and restricted subsets of C++ that don't use templates) that can be used to tell the computer what to do. Almost every high level language we have already abstracts away the idea that you are trying to control a piece of hardware. Game programmers are in an ideal position to have learned what is actually needed to make talking to a computer more efficient. The fact that J also has the vision to build the language to account for real world development processes is almost like an added bonus.
Re:The Witness: the creator of Braid talks about his fiendis... by bsder on Thursday September 17, 2015 @09:42PM (#10237111)
Presumably Rust wasn't stable enough for him to consider because that's the single language that seems to address his complaints.

Once you bar garbage collection, you're pretty much left with C, C++, and Rust (FORTRAN weenies can leave the room, thanks).

Re:The Witness: the creator of Braid talks about his fiendis... by GolDDranks on Thursday September 17, 2015 @11:10PM (#10237309)
Also, he doesn't like Rust's stance on safety -- he thinks it's going to lead to too much hand-holding and boilerplate annotations.
Re:The Witness: the creator of Braid talks about his fiendis... by pcwalton on Friday September 18, 2015 @12:31AM (#10237472)
Yes, that's the main design difference between Jai and Rust.

My personal feeling is that memory safety isn't something I want to compromise on. But, I work on browsers and not games, so I'm perfectly willing to acknowledge that, for games, developers may be willing to sacrifice safety for fewer type system restrictions. Browsers, critical OS components, databases, etc. are security critical, while games aren't. I'm a pluralist when it comes to programming languages, and I'm perfectly willing to accept that there are prima facie valid reasons for not wanting memory safety. One thing I like about Jai is that it's very up-front about not being type-safe or memory-safe, and specifically argues against the usefulness of memory safety for its domain.

It's interesting, though, that whenever I've floated the possibility of relaxing restrictions on an opt-in basis for apps that don't care about memory safety as much the reaction of the Rust community has been lukewarm at best and usually pretty negative, even from the game devs. It's interesting: most people don't want to give up their memory safety, once they see the benefits that it brings in terms of developer productivity (preventing annoying bugs). That's the camp I'm in too, at least for the apps I write.

Re:The Witness: the creator of Braid talks about his fiendis... by renox on Friday September 18, 2015 @05:42AM (#10238260)
In one of his latest video he show how it is going to work for array access: by default it's checked, but you have a directive to make one (or a block) of array access unchecked and then you have a global directive which can change the default to check all the array access or NOT check all the array access. So you get the full range from safe array access to C-like performance and with the possibility of dropping the checks only where this impact really performance.

Memory safety isn't limited to array access, but I really like the idea of this kind of control (even though for library this could create issue, I think that there are plans to allow the use of an 'ANDF' like format for libraries).

Re:The Witness: the creator of Braid talks about his fiendis... by pcwalton on Friday September 18, 2015 @07:51AM (#10238621)
Bounds checking isn't as interesting as use-after-free protection (like the borrow check) for a couple of reasons: (1) you can easily opt-in and opt-out on a case-by-case basis (even in Rust), whereas UAF protection is nonlocal; (2) bounds checks rarely if ever show up in profiles with a well-designed iterator library and an optimizing compiler.
Re:The Witness: the creator of Braid talks about his fiendis... by renox on Friday September 18, 2015 @09:29AM (#10239044)
I mostly agree with you (UAF is more interesting but more difficult that bound checking), but I would nitpick on details:

- yes you can opt-in and opt-out on a case-by-case basis in Rust for bound checking but can you globally remove checks and globally force checks?

- as for UAF protection being non local, a true UAF protection true but a 99% solution such as overwriting the data with know garbage on free (0xDEADBEEF) and ensuring that the allocator doesn't reuse virtual addresses may be good enough in practice, no? But yes it's probably too expensive to release with such configuration..

Re:The Witness: the creator of Braid talks about his fiendis... by pcwalton on Friday September 18, 2015 @10:58AM (#10239555)
> - yes you can opt-in and opt-out on a case-by-case basis in Rust for bound checking but can you globally remove checks and globally force checks?

No. Nobody has asked for it, because nearly all bounds checks in Rust just don't matter from a performance point of view, and thus there is no reason to remove them.

> - as for UAF protection being non local, a true UAF protection true but a 99% solution such as overwriting the data with know garbage on free (0xDEADBEEF) and ensuring that the allocator doesn't reuse virtual addresses may be good enough in practice, no?

You can't avoid reuse of virtual addresses. That would have terrible cache implications.

The only thing that sorta works is something like WebKit's PartitionAlloc, but that only mitigates some exploitation scenarios. There is no easy solution to UAF.

Re:The Witness: the creator of Braid talks about his fiendis... by renox on Monday September 21, 2015 @04:35AM (#10251061)
> You can't avoid reuse of virtual addresses. That would have terrible cache implications.

--> terrible TLB implications

> There is no easy solution to UAF.

Agreed.

Re:The Witness: the creator of Braid talks about his fiendis... by whyever on Friday September 18, 2015 @06:22AM (#10238343)
> Browsers, critical OS components, databases, etc. are security critical, while games aren't.

This is only true for singleplayer games. For multiplayer games security is critical, because they are exposed to the internet.

Re:The Witness: the creator of Braid talks about his fiendis... by steveklabnik on Friday September 18, 2015 @07:57AM (#10238643)

  > How about designing a language for programmer joy.
Matz says that he created Ruby to make programmers happy, specifically.
Re:The Witness: the creator of Braid talks about his fiendis... by Glench on Thursday September 17, 2015 @07:16PM (#10236655)
Jon said in his first few youtube talks that he doesn't want this to be a "big idea" language, but one that is basically proven to work already for him.
Re:The Witness: the creator of Braid talks about his fiendis... by brandur on Thursday September 17, 2015 @07:38PM (#10236731)
Exactly. The linked video is slightly dated (about a year old), but it's recent enough that he's able to talk about modern languages (Go, Rust, and D) and why he doesn't believe that they'll be suitable for practical game development.
Re:The Witness: the creator of Braid talks about his fiendis... by fulafel on Friday September 18, 2015 @02:43AM (#10237803)
A lot of non-syntactical departures from C/C++ : data layout options (soa vs aos), bounds checking, reflection, function polymorphism, baking, initialization control, ... lots more at https://sites.google.com/site/jailanguageprimer/