Here are the reasons
Have I said enough?
Based on my very limited experience with both, though, I'd say there's at least one major difference: Scratch keeps custom blocks and variables pretty clearly separate, while assembly is much closer to the machine level, where addresses, instructions, and data can interact in ways Scratch simply doesn't allow.
In Scratch, custom blocks aren't first-class citizens: you can't store a custom block in a variable and pass it around. That limits the kinds of abstractions you can build. For example, you can make something that maps a fixed operation over a list, but you can't really write a fully general map function that takes another function as an argument.
So while both can feel "low-level" in the sense that you often build things step by step, I wouldn't say they're all that alike in terms of abstraction mechanisms.
Just my two cents.
Plovie - go to this post
Based on my very limited experience with both, though, I'd say there's at least one major difference: Scratch keeps custom blocks and variables pretty clearly separate, while assembly is much closer to the machine level, where addresses, instructions, and data can interact in ways Scratch simply doesn't allow.
In Scratch, custom blocks aren't first-class citizens: you can't store a custom block in a variable and pass it around. That limits the kinds of abstractions you can build. For example, you can make something that maps a fixed operation over a list, but you can't really write a fully general
mapfunction that takes another function as an argument.So while both can feel "low-level" in the sense that you often build things step by step, I wouldn't say they're all that alike in terms of abstraction mechanisms.
Just my two cents.
Indeed, the Scratch VM manages data quite differently. Instead of fixed-size registers everything is a string. There is no single address space for memory; each variable and list more-or-less has its own distinct address space (as accessed with (letter (x) of (y)) or (item (x) of list [y]).
This is sort of similar to a Harvard architecture machine, as the program does not exist in the same address space as its data; most modern computers use von Neumann architecture, which is reflected by their assembly programs.
Still, I had a reason to make this comparison. The idea that something as low-level as assembly and something as high-level (and introductory, even) as Scratch have so many things in common is quite funny to me, especially since most comparisons can't be made to high-but-lower-level languages (i.e. JavaScript manages a stack, makes data structures easy, etc).
Sort of a tangent, but I'd like to note that code (albeit not individual instructions) is addressable in Scratch. The first example to come to mind is how Scratch's broadcast operation can take an arbitrary broadcast name, effectively letting broadcast names work as addresses; using broadcasts could lead to performance issues though.
I also hear that in Scratch 3.0 it's possible to pass arbitrary custom block names to the procedure call block using input/field shenanigans, though I could be mistaken and either way I forget the details. Either way you can do some crazy stuff with inputs and fields in said version, for instance nesting lists, and that's only scratching the surface!
max - go to this post
Sort of a tangent, but I'd like to note that code (albeit not individual instructions) is addressable in Scratch. The first example to come to mind is how Scratch's broadcast operation can take an arbitrary broadcast name, effectively letting broadcast names work as addresses; using broadcasts could lead to performance issues though.
Sounds more like pub/sub or message dispatch, with the broadcast names acting as topics/labels.
max - go to this post
I also hear that in Scratch 3.0 it's possible to pass arbitrary custom block names to the procedure call block using input/field shenanigans, though I could be mistaken and either way I forget the details. Either way you can do some crazy stuff with inputs and fields in said version, for instance nesting lists, and that's only scratching the surface!
Aaaaaaand if they keep going in that direction, it might eventually turn into a block-based Lisp dialect 
Plovie - go to this post
Sounds more like pub/sub or message dispatch, with the broadcast names acting as topics/labels.
I suppose so. Broadcasts also spawn new "threads" (and are sometimes used for background tasks).
Aaaaaaand if they keep going in that direction, it might eventually turn into a block-based Lisp dialect ;)
That reminds me, Scratch 2.0 projects are encoded into a lisp-like JSON format. For instance, ((timer) > (20)) is [">", ["timer"], "20"] I think.
naw naw naw nix and c feel similar even though i never used c i have only seen it
Parker2991 - go to this post
naw naw naw nix and c feel similar even though i never used c i have only seen it
Well, I hadn't seen much Nix before, but from a quick look, the C similarity seems pretty superficial. Nix is a high-level, lazy, purely functional DSL – much closer in spirit to Haskell than to C.
Plovie - go to this post
Well, I hadn't seen much Nix before, but from a quick look, the C similarity seems pretty superficial. Nix is a high-level, lazy, purely functional DSL – much closer in spirit to Haskell than to C.
ic
Parker2991 - go to this post
naw naw naw nix and c feel similar even though i never used c i have only seen it
I've only taken a brief look at Nix but it quite frankly makes me think of JavaScript, and maybe other languages I've worked with like Python, Lua, PHP, and more.
Most programming languages you'll encounter have taken some inspiration from C. All sorts of syntax like my_function(), a == b, a || b, int example = 1;, /* this is a comment */ can be seen in C but also other languages like Java.
I doubt C was the original source for all of it, but I wouldn't really know. Still, I wouldn't be surprised if it's where the other languages sourced their ideas from. Runtimes/interpreters/etc are often written in C and maybe also C++ which was derived from it too.
Also I now remember that Scratch technically does have a stack, but only for custom block calls and such AFAIK.
max - go to this post
I've only taken a brief look at Nix but it quite frankly makes me think of JavaScript, and maybe other languages I've worked with like Python, Lua, PHP, and more.
Most programming languages you'll encounter have taken some inspiration from C. All sorts of syntax likemy_function(),a == b,a || b,int example = 1;,/* this is a comment */can be seen in C but also other languages like Java.
I doubt C was the original source for all of it, but I wouldn't really know. Still, I wouldn't be surprised if it's where the other languages sourced their ideas from. Runtimes/interpreters/etc are often written in C and maybe also C++ which was derived from it too.
now thinking of it, it reminds me of json
Parker2991 - go to this post
now thinking of it, it reminds me of json
Well JSON does kinda stand for JavaScript Object Notation.
Powered by esoBB
522 posts - 57 conversations - 1 member online