953 karma · joined November 27, 2012
But contrary to this, I think explicitly separating function declaration and function calling, in the following kind of syntax, would make it much clearer and less complected where the initial condition `tree = fork(0)` comes from. In the original example it came from `bend x = 0`, but here the function declaration is separate and the call more explicit: so it more obviously comes from `createTree(0)`:
type Tree
Branch { left, right }
Leaf { value }
def main():
createTree(x):
x < 3 ?
Tree.Branch { left: createTree(x+1), right: createTree(x+1) }
Tree.Leaf { value: 7 }
createTree(0)
Besides not needing a local variable `tree` here, the unique thing here is the elimination of the else-clause, to reduce unnecessary nesting, and a rule that the language just early returns the last result of any nested condition. If it doesn't go into any nested condition, then it just returns the last result in the main function body (like Ruby). Without any `return` keywords needed in either case. Wouldn't this be quite beautiful?It makes sense to have to opt-in to floats for performance in domains like scientific computing or graphics (where silent precision loss matters less). But in all other cases business logic (money etc.) would give you normal arithmetic as you would expect.
It also makes sense to not allow numbers to overflow to the Heap, but rather have the programmer take special care for exceptionally high numbers.
Having no shenanigans between the compiler output and the runtime output is also a sane choice (staying true to predictability / determinism).
All in all, it sounds like good language design choices for a Web Server and Business Applications focused language such as Roc.
While predicate logic (first-order logic) provides the logical foundation for logic programming (Prolog etc.) and databases, functional programming is based on the different formalism of the lambda calculus.
There are proposals to combine functional and logic programming paradigms into "functional logic programming" languages, but these involve mapping between the two rather than being purely based on predicate logic.
Abstract:
«Logic programming is a flexible programming paradigm due to the use of predicates without a fixed data flow.
To extend logic languages with the compact notation of functional programming, there are various proposals to map evaluable functions into predicates in order to stay in the logic programming framework.
Since amalgamated functional logic languages offer flexible as well as efficient evaluation strategies, we propose an opposite approach in this paper.
By mapping logic programs into functional logic programs with a transformation based on inferring functional dependencies, we develop a fully automatic transformation which keeps the flexibility of logic programming but can improve computations by reducing infinite search spaces to finite ones. «
Released over a year after Braid.
«Waaaay back in 2010 I gave a talk at the GDC detailing exactly how rewind was implemented in Braid, including e.g. how does it reproduce all the particles perfectly without using tons of data.«
But I was able to find his original blog post, which show the particle system code and crucially shows the animation of what parts of the visuals the particle system (with the random number seeding etc). was actually for:
http://number-none.com/blow/blog/programming/2016/07/07/brai...
(The particle system - recreate particles from scratch every time, and just go one step less, N-1, when rewinding - reminds me of Redux’ time travel algorithm, as demoed by Dan Abramov.)
I also found the original GDC talk Blow referenced, where he details the rewind system more fully, with illustrations. It becomes more clear that the world state is comprised of regular game objects in addition to particles. His overall approach was:
«Record full world state for every frame, always. Do not drop frames. Compress data somehow.»
(Reminds me of React’s «rerender whole UI, but virtual DOM diff afterwards», approach.)
Skip to 3:00 for the various rewind approaches he considered but dropped (including the StarCraft replays like approach of capturing actions and playing them back): https://www.gdcvault.com/play/1012210/The-Implementation-of-....
" This concerns mostly East Mongolia, and it can be a good thing for the nature, even though it is disastrous for many shepherds/herders. It's now more than 3x as many livestock animals in the country compared to when communism fell in 1990. Over-grassing kills the steppes and makes the desert spread in record speed. So if half of the livestock animal population would die, it would be, as said, good for the nature, but crap for the shepherds/herders.
If you want to see the official animal statistics check out http://1212.mn/en "
If you weren’t allowed to drive on the highway, but everywhere else, would your freedom of movement not be suppressed, to some degree?
If in North Korea they’d allow you to say whatever you want as long as you only shouted it from the top of a mountain when alone, or wrote it on a note and buried it in your backyard, would they have freedom of speech?
“Everything that can be invented has been invented.”»
use the documentation at https://www.crockford.com/misty/actors.html to show an actor code example
show me the 3 simplest examples of rosettacode implemented in crockford's misty programming language
So instead of:
["a", "b", "c"] |> List.append "d" |> List.append "e" |> List.append "f"
You could have:
["a", "b", "c"] |> append "d" |> append "e" |> append "f"
Since Roc knows that the type returned from each function is a List.
Or, you’d have to continue expanding the old code using only the old language/methods (here: JS instead of TS).
And then programmers came along and mangled the mathematical notion of the equals sign with the imperative notion of assignment. And here we are. Using = for assignment when we ought to have been using : instead, if we were to rely on people’s intuitions from reading and writing.
Which of course is difficult now that : has been co-opted by type systems.
vite-plugin-ssr (soon called Vike) and RakkasJS comparison: https://dev.to/redbar0n/comment/28nbg
* React Native & Expo * NextJS * Tamagui (styling + prebuilt UI components + tree-flattening compiler) * Supabase preconfigured w/ auth, login screens etc.
With 100% code sharing between RN and web. So you effectively get an iOS, Android and SSR’ed app on the Web from a single codebase.
What’s particularly interesting is that it goes further than a normal starter / bootstrap repo in that they have a GitHub bot that gives you automatic updates via Pull Requests.
A new model to fund open source?
My estimation is that fully integrated starter kits like these potentially saves weeks of integration time.
See also the previous HN post on Tamagui v1.0 release: https://news.ycombinator.com/item?id=34186742