News for hackers. Stuff that matters.
Re:Show HN: VisionScript, abstract programming language for ... by tgv on Monday August 21, 2023 @04:13PM (#37214744)
Looks cool. I'm not sure about the implicit state in the language. It sort of worked for Hypercard, but not always.

And can you iterate over multiple objects with the same label, e.g. if you want to replace all faces by emoji?

Re:Show HN: VisionScript, abstract programming language for ... by zerojames on Monday August 21, 2023 @04:25PM (#37214888)
Thank you for your comment! Iteration is in the works right now.

I wrote this script at the weekend:

    Load["./bus.jpg"]

    In[Detect["person"]]
        Greyscale[]
    Endin

    Show[]
In[] is our iterator (which came from "in a folder", which was the original use). I'm adding data types. In the above program, In[] is iterating over a Detection object. Behind the scenes, each bounding box is selected, the nested statements (in this case, Greyscale[] are evaluated), then any transformations are applied to only the regions in the bounding box.

Thus the impact is:

    1. Load a file
    2. Find all the people
    3. For each person, turn that region greyscale
    4. Show the resulting image
My rationale for implicit state (I haven't heard that term until now -- thank you!) is that it may be more intuitive for a beginner. Maybe that will be wrong, but I'm eager to experiment!

(I am beyond elated to be on the front page of HN!)

(edited to get the code snippet and list formatting right!)

Re:Show HN: VisionScript, abstract programming language for ... by tgv on Tuesday August 22, 2023 @09:22AM (#37222342)
I don't know where I got the term "implicit state" from. It might have been an article or a discussion or even a spontaneous thought.

> it may be more intuitive for a beginner

It keeps things simple, true, but the conceptual leap is bigger when it no longer suffices. But that's a bit of a luxury problem.

I'll be keeping an eye out on your repo.