HackerTrans
TopNewTrendsCommentsPastAskShowJobs

brucifer

no profile record

comments

brucifer
·letzten Monat·discuss
> He kinda showed off Siri as like the Star Trek computer for your phone.

This is a truly damning comparison. In Star Trek, the massively powerful ship's computer is mainly ignored in favor of touchscreen interfaces and the natural language voice controls on the computer are mainly used for making tea and occasionally asking a question, which the computer often can't answer or answers incorrectly. All real work is done using other interfaces.
brucifer
·vor 5 Monaten·discuss
OP here, it might be a bit unfamiliar at first, but I think Tomo's syntax makes the type annotations really nice for functions that return functions: `func make_adder(amount:Int -> func(x:Int -> Int))` instead of `func make_adder(amount:Int) -> func(x:Int) -> Int`. The latter can be easily mistaken for a function that returns an integer since it starts with `func make_adder(` and ends with `) -> Int`, especially if you're not well-versed in currying. With Tomo's syntax, it's easier to see at a glance that `make_adder` returns a function without the need to add extra grouping parentheses for clarity. IMO, Tomo's syntax is also a bit more readable for lambdas when the return type is specified: `func(x:Int -> Int) x+1` vs `func(x:Int) -> Int x+1`
brucifer
·vor 5 Monaten·discuss
OP here, I just went with indentation-based syntax because I prefer indentation over curly braces aesthetically. I've got no problem with people who prefer curly braces and I find C very enjoyable to work with. However, when I started the language, I wasn't starting with a C parser and modifying from there, I was writing the parser from scratch, so I opted to go with the syntax I enjoy most. I'd like to think that Tomo's syntax is easy enough to pick up, especially for anyone who has used Python before.

I actually agree with you that syntax is not one of the things that makes C hard. C's syntax is mostly very easy to work with (apart from a small number of edge cases). The actually challenging parts of working in C are things like manual memory management, doing good error handling, the lack of proper namespaces or modules, a sometimes-footgunny standard library, and so on. I wanted Tomo to improve on the usability and safety of those areas, while keeping the parts of C that I really love: a simple type system, pointers as a language concept, fast parallel compilation (one source file -> one object file), and a programming model that feels closer to what the silicon is doing than most languages.