4 ms·
I find it hard to get into Forth, in part because every time I ask a Forth developer what they use Forth for, they simply say "writing my own Forth". It seems t
by bowsamic 3y ago
I find it hard to get into Forth, in part because every time I ask a Forth developer what they use Forth for, they simply say "writing my own Forth". It seems to be Forths all the way down. When I tried to write a piece of software in it, a basic TODO list app, and had issues with dynamically sized arrays, every Forth programmer I asked said "this task is not suited for Forth". Okay, then what is? Very strange
- jacquesm 3y ago> Okay, then what is? Bootstrapping new hardware. Industrial control (real time). Firmware. Compilation target.
- bowsamic 3y agoI mean fair enough but a lot of Forth fans try and sell it as a general purpose programming language and even compare it to things like LISP, but it's obviously really not, it's very domain specific.
- jacquesm 3y agoFORTH isn't necessarily domain specific when you start a project, but it always is by the time you finish. In that sense it is actually much more like LISP than most other languages, it is scaffolding that allows you to build a DSL (in FORTH probably in the most literal sense of the word(s)).
- bowsamic 3y agoIf the language struggles to handle dynamically sized lists of data then it's hard to consider it not domain specific
- jacquesm 3y agoWhy? Plenty of general purpose programming languages have this property. Only LISP and Clojure really get that one right.
- bowsamic 3y agoI've never used any other language that has this property, and I've used C, C++, C#, Haskell, Java, Javascript, Rust, Python, Mathematica. All of them have easy to use dynamically sized arrays
- jacquesm 3y agoYou wrote 'lists' not 'arrays'.
- bowsamic 3y agoThese terms are often used interchangeably, for example they're called lists in python
- mst 3y agoIn general, in a discussion about or adjacent to programming language design, people will tend to expect 'list' to be used to mean a data structure that behaves like a singly linked list ala lisp's cons cell based list data structures. The programming styles list-first and array-first languages encourage are sufficiently completely different that using them interchangeably tends to be a really bad idea, and honestly python's arrays being named that way irritates me even if I don't consider 'this irritates me' to be a criticism per se.
- jacquesm 3y agoThey are not used interchangeably when you're discussing programming language features, precision matters.
- kazinator 3y agoPython uses all sorts of nonstandard terminology. For instance, in computer science "literal constant" has a very specific meaning. Python calls things "literals" that are obviously not literals; for instance [1, 2, 3] is actually a constructor which allocates a new li^H^Harray each time it is evaluated. A true literal does no such thing; its syntax retrieves an object which has been placed into the program image; it typically exists before the program even starts. Programs depend on the semantics of [1, 2, 3] making a new object each time; a Python compiler cannot just deduce that because all arguments are constants, it can be turned into a literal. You don't want to learn computer science terminology (or computer science at all) from Python.