Readit News logoReadit News
graboid commented on An attempt to articulate Forth's practical strengths and eternal usefulness   im-just-lee.ing/forth-why... · Posted by u/todsacerdoti
Surac · 10 days ago
I often use a heavily forth inspired script language in my bigger c# projects. I have a hidden repl and can input scripts. I like how easy it is to produce results with such low vocabulary. Also there is no expression parsing
graboid · 10 days ago
Sounds cool, as someone interested in concatenative languages and also a user of C#, might I ask if you have a link?
graboid commented on Forth: The programming language that writes itself   ratfactor.com/forth/the_p... · Posted by u/suioir
rpcope1 · 2 months ago
If you like Forth, but find it challenging to build real stuff with, Factor (https://factorcode.org/) is most or all of the good stuff about Forth designed in a way that's much easier to do things with. It was designed by Slava Pestov (who I think had a big hand in Swift), and honestly it's a lot of fun to build webapps and other programs with, and much less brutal to read than Forth can be.
graboid · 2 months ago
Factor is super cool! And the amount of packages ("vocabularies") it comes bundled with is just astonishing.
graboid commented on Zoo of array languages   ktye.github.io/... · Posted by u/mpweiher
graboid · 2 months ago
I assume that in most array languages, you also create "words" or however you want to call functions, to reuse code. I wonder about a purely aesthetic issue: how does it look to interleave those symbols with user-defined words that by nature will be much, much longer, i.e. "create-log-entry" or "calculate-estimated-revenue".
graboid commented on Don't build a spaced repetition startup   giacomoran.com/blog/dont-... · Posted by u/ran3000
graboid · 3 months ago
It is a very interesting write-up. A random thought I had while reading this: I feel like long-term, a system that schedules/"optimizes" the process of learning by reading/watching content and then engaging with this new content by taking notes and connecting those notes to existing knowledge could be more fruitful. Something akin to SuperMemo's "Incremental Reading", but not as focused on creating flashcards out of the material.

With traditional Q/A-style spaced repetition, I feel like accumulating a long list of isolated facts sometimes (I know, you can remedy this a bit by also quizzing connections, context, but I feel like the general tendency still remains).

graboid commented on The End of Handwriting   wired.com/story/the-end-o... · Posted by u/beardyw
foo42 · 4 months ago
I write with my hand below the line to avoid smudging. A consequence of this is my pen meets the page at quite a shallow angle which I find is perfect for fountain pens but scratchy with ball points. These days I do very little hand writing and find my traditional pose (described above) causes hand cramps, but I don't know if that's specific to the odd way I write or if all poses would when so out of practice
graboid · 4 months ago
Did you learn that handwriting pose already as a child? If not, how hard was it to teach yourself writing that way?
graboid commented on How we enforce .NET coding standards to improve productivity   anthonysimmon.com/worklea... · Posted by u/fratellobigio
graboid · 5 months ago
At work, we use the .editorconfig of the .NET runtime, with slight modifications:

https://github.com/dotnet/runtime/blob/main/.editorconfig

graboid commented on Why concatenative programming matters (2012)   evincarofautumn.blogspot.... · Posted by u/azhenley
norir · 5 months ago
This is mostly a problem of concatenative language design. There is nothing preventing function definitions from having type signatures that are statically checked. In my concatenative language compilers, I always provide a function that causes the compiler to halt and print out all of they types on the stack at the call site during compilation as well as a runtime function that prints out the runtime values. I have found this to be quite effective for debugging. Because I don't support global variables, these functions give a complete view of ALL of the live values at any point in the program, which is quite hard in most languages.

Local variables are also not necessary to have reasonable ergonomics, even in mathy contexts. Instead, the language can define special operators that access fields on the stack by type name and move or copy them to the top of the stack. For some reason, in the math example, the author deliberately added an unnecessary parameter that had to be dropped and put the arguments in the wrong order. Cleaning up the signature, there are several reasonable ways to solve the problem in a concatenative language with the features I've described.

    type n number
    type y n
    type x n
    def op_math_example [(y x) -> (n)] \\x * \\y \\y * + \y abs -
where \FOO moves a value of type FOO to the top of the stack and \\FOO copies the value to the top, leaving the original where it was. Yes, the \\ is a little ugly, but these should generally be used sparingly.

Even if we restore the original signature and use the author's syntax, there is a much cleaner solution to the problem without the move/copy operators.

    def sq dup *
    def op_math_full drop swap sq over sq + swap abs -
This is extremely cryptic. I suspect most forth programmers would have added a stack signature comment, but it is even better if the compiler statically verifies the signature for us, which is how the language I am describing differs from vanilla forth (where stack comments also have the risk of being wrong in an evolving system). If we restore the type system, it becomes:

   type n number
   type x n
   type y n
   type z n
   def sq [(n) -> (n)] dup *
   def op_math_impl [(y x) (n)] sq over sq + swap abs -
   def op_math_full [(x y z) -> (n)] drop swap op_math_impl
Of course it is still not as obvious to the reader what op_math_full actually does as (y * y) + (x * x) - abs(y). But in practice it would have some name like projection_size so once it has been written correctly, it doesn't really matter that it is a bit obscure to read at a glance. You also get really good at simulating the stack in your head and they type signature makes this much easier. Still, when you are confused, you can always add stack debugging like so:

    def projection_size [(x y z) -> (n)] drop swap PRINT_STACK sq over sq + swap abs -
    1 2 3 projection_size
and the output would be something like:

    ({ y 2 } { x 1 })
Writing programs in this style is very nice so long as you have enough tooling to facilitate it.

I have only used concatenative languages that I have implemented myself, however. I have read quite a bit about forth, but for me, there are clear problems with vanilla forth that are solved for me with the meta operators like [, [[, \ and \\ as well as good debug tools like PRINT_STACK above. Forth was an incredible discovery for its time. We can do a lot better now.

graboid · 5 months ago
Hi, as someone also fiddling around with a concatenative toy language, I wanted to ask if any of your languages have a public repository somewhere? You seem very knowledgeable on the topic and your descriptions made me interested.
graboid commented on A receipt printer cured my procrastination   laurieherault.com/article... · Posted by u/laurieherault
hyperific · 6 months ago
What app are you using?
graboid · 6 months ago
See my answer on the sibling comment.
graboid commented on A receipt printer cured my procrastination   laurieherault.com/article... · Posted by u/laurieherault
laurieherault · 6 months ago
Thanks for your comment! I have the same question as hyperific — which app are you using?
graboid · 6 months ago
https://sweepy.com/

There is also one that is called "tody" that we didn't try out. Both require a small subscription fee though, which I really dislike. I wish I had found a nice open source alternative. Besides the subscription fee (which was like 18€/year for us both), I have no complaints yet about the app.

graboid commented on A receipt printer cured my procrastination   laurieherault.com/article... · Posted by u/laurieherault
graboid · 6 months ago
I like it! For me, I can confirm that the smaller the task, the less likely it is for me to procrastinate on it. I also didn't know that receipt printers don't need ink, that's cool. On a similar note: me and my partner recently also started using an app that divides up the household chores into small tasks and schedules them for us (e.g. "today you have to vacuum the living room"). For us, this prevents conflicts and also frees the mind of having to keep track of those things.

u/graboid

KarmaCake day122May 23, 2022View Original