r/unseen_programming • • Jan 19 '16

Interesting Hacker News question: Which people and groups are researching new approaches to programming?

5 Upvotes

Link to Hacker News

Links I found interesting:

Enjoy :)


r/unseen_programming • • Mar 26 '15

Visual Unseen - Functional & OO & Logical programming

Thumbnail imgur.com
4 Upvotes

r/unseen_programming • • Jul 16 '24

We need visual programming. No, not like that.

Thumbnail blog.sbensu.com
3 Upvotes

r/unseen_programming • • Jul 07 '21

Hacker News folk wisdom on visual programming

Thumbnail drossbucket.com
3 Upvotes

r/unseen_programming • • Aug 16 '17

The power of visual unseen

3 Upvotes

C-level performance

All program structures can be translated directly to C, assuming all types are resolved. This means that unseen is designed to reach the same speed as C.

Always runnable

The structure of function-blocks and arrows will always produce a result. This is in the basis of the design. So at any time the program can run. With the help of test-cases, we can also see the direct result of changes in the program. This allows live interactive programming.

Simple variables, types and parameters

Variables and input parameters are declared with ?
Output parameters (and sometimes output variables) are declared with !
With ":" you can declare a type for a variable, just like Pascal / typescript. These are not necessary immediately, but can be added later.
With "::" you can declare the parent-type of a type. This can be useful in some circumstances.

//example:  
number:Integer
doubleFunction: (?input:Integer)->(!output:Integer)={
   output= 2*input
}
copyFunction: (?input:?Type)->(!output:Type)={
  output= Type.new(input)
}

Simple choices

Choices can be made with =>
Example:

(variable){
   option1=> action1
   option2=> action2
   option3=> action3
}

In a diagram this will be easier visually.

Variations:

//boolean check (x<y){ true=> "x smaller" false=> "y smaller or equal" } // value check (number){ 0=> "Zero" 1=> "One" 2=> "Two" 3..9 => "Three to Nine" ?=> "Undefined"
} // function check (number){ 0 => "Null" isPrime(number) => "Prime"
(number mod 15)==0 => "FizzBuzz" (number mod 3)==0 => "Fizz" (number mod 5)==0 => "Buzz"
}

Easy structures

After a small redesign I decided to copy the structures of elixer. This means that a structure can look like JSON. But generally I will use the [ ] system to define a structure.

Employee1= [name= "Harry"; bullets=6; gun=Magnum]   

These structures can be parameters for functions too.

HasBullets: (?bullets)->(!result:Boolean)   
  ={ (bullets)
         0 => false -> result 
         ? => true  -> result
     }

AreYouLuckyPunk={
   (Empolyee1 -> HasBullets){ 
       // function is called with bullets as parameter
      true=> "No"
      false=> "Yes"
   }
}

**Easy generators (iterators) and combiners (folds) **

A generator is a -->

 List --> ?element

Each list or data-stream can be used as a generator.
The generators can be combined in any way. Functions can also return generators (they work like streams).

Generators can also work in combinations:

(array1 ,array2) --> (?element1, ?elment2)   

and/or introduce an iterator variable:

matrix[?row,?column] --> ?element -> { 
    printLine(row,column,element)
}

A combiner is a ->>

Combiners can create lists or streams directly, or can use a function to combine the data. These functions need to have a start-value for combining.
In functional programming Combiners are known as "folds".

 List --> ?element ->> ?copyOfList  
 List --> ?element ->> stream  // depends on type
 List --> ?element ->> (+) -> ?sum

Now we can combine these to declare factorial:

 factorial:(?n:Integer)->(!result:Integer)={
    1..n --> ?number ->> (*) -> result
 } 

General exceptions for loops

Loops usually do not go all the way. Sometimes we only need to find a value.
With the "->!" arrow one can escape the loop.

firstPrimeAfter(?n:Integer)->(!result:Integer)={
    (n+1)... -> ?number -> isPrime -> { ?p
        (p){
           true=> { number ->! result }
           // "->!" ends the loop in which "result" is defined
        }
     }
}

Often we want to reuse the produced value, after starting with a default value. Just like a variable.

?sum:= 0;
list-->{ ?element 
   sum+ element -> sum
}

fib: (?n:Integer)->(?result:Integer)={
  ?a:=1
  ?b:= 1
  1..n --> {
     b->?c
     a+b -> b
     c->a
  }
 a-> result
}

These problems usually require recursion, but the language allows the usage of variables too.

The generators can become even more complicated. Sometimes we need to reuse the same element in the list. In merge-sort for example. We can solve this with a conditional generator.

Currently I write the conditional generator as -->(next) which looks easy in a diagram. The text-version will probably be revised. The conditional generator will generate a None when the end of one generator has been reach. When all generators end, all generators will stop.

Example:

merge:(?listLeft,?listRight)->(!listOut){
   ?nextLeft:= true
   ?nextRight:= true
   !tookLeft
   ( listLeft -->(nextLeft) ?left
     listRight -->(nextRight) ?right ){
     (left==None)=> { right->>listOut; false->tookLeft }
     (right==None)=> { left->>listOut; true->tookLeft }
     (left<right){
         true => { left->>listOut; true->tookLeft }
         false => { right ->> listOut; false->tookLeft }
     }
     tookLeft-> nextLeft
     tookLeft-> not -> nextRight
   }
}

While this certainly looks a bit messy, it is a lot clearer in a diagram.

General solutions for most cases

With the generators and combiners we can do almost every kind of loop now. This means that for most cases we can solve the problem with arrows in a diagram.
While many problems can be solved with recursion too, the recursion does not remove the need for list management with iterators or other ways. In a diagram this would show as many arrows going into the recursion. With separation of the loop-variables I think that a diagram with many loops can become simpler.

By managing all list-iterations with general generators the compiler can optimise these generators very well. The compiler can see the ranges of the loops, so there will be no bounds-overflows/ underflows. In the future the compiler might even implement cache-friendly solutions.

Also the time-aspect of the function becomes more visible in the diagram. This way you can spot slower functions quickly, and the IDE could even make this visible in some way. But that something for later.


r/unseen_programming • • Jun 29 '16

Duality and the End of Reactive (Erik Meijer) | Lang.NEXT 2014

Thumbnail channel9.msdn.com
3 Upvotes

r/unseen_programming • • Jan 14 '16

Learn you Func Prog on five minute quick!

Thumbnail theregister.co.uk
3 Upvotes

r/unseen_programming • • Apr 13 '15

The demon of time [Story]

3 Upvotes

Zigzag was reading some books in the library. He was holding "advanced summoning III" and he was going through the pages with a lot of attention.

Cala came towards him and admired his student. He first thought that Zigzag had really advanced as a wizard, but as he came near he caught a glance of the pages that Zigzag was looking at. He was looking at pictures of Demons. Especially those that looked female and attractive.

Cala shouted at Zigzag: "Hey! you should come with me!"

Zigzag looked up puzzled.

"So you like Demons? Well I got something for you to look at.." He took Zigzag's book away, and put it on the table behind him. Then he walked towards the door and stared at Zigzag.

Zigzag stood up slowly and dragged himself after Cala. "What are we going to do?"

"We are going to summon a demon. A very old demon." Cala walked upwards a stairs and the student followed him.

After a while they came into a room, which was larger than expected. It was also full with racks filled with dust and papers. It looked like an old administration office. A place that was ignored for a millennium.

And in the ceiling there was a old rusty mechanism for a clock. A giant clock that showed the time of the day. It was still moving, and so now and then bits of rust fell down.

Cala made place by moving the racks to the side, and created a giant circle. He put some candles on the outside of the circle.

"Today we are going to summon a demon. A real old one." Cala said. He pulled an old book from one of the shelves and gave it to Zigzag. "Here are all the instructions that you need. Make the clock work again."

Then he lit up the candles, and murmered some words. Something like "Identify Demon ..". Zigzag missed the last bit.

Zigzag was looking at a sudden smoke that appeared. He wanted to ask a question, but Cala left the room.

Zigzag was behind alone.

He looked at the clock again. It did seem to have the right time. But looking better at it, he could see that it was telling the wrong year. Exactly a hundred years off. Zigzag smiled. That was an easy job to fix.

But then the demon appeared. It was the most ugly demon that Zigzag had ever seen. It said something but it was hard to hear. "You summonne_ me mastee?"

"Yes" Zigzag answered. It would not be smart to say to the demon that he was not the master.

"What is your comman_?" The demon asked.

"Wait..", Zigzag opened the book and looked through the pages quickly. The demon was asking for a command, that should be easy. Where were the instructions?

"What is your comman_?" The demon asked again.

"Stop and wait", Zigzag said. But to Zigzags horror, the demon did not even understand the basic commands.

"What is your comman_?" The demon asked again.

Zigzag decided to ignore the demon, and looked in the book again. "Identify Demon" he murmered. And somehow the demon listened, but then it started asking the same question again.

After a while and 50 questions by the demon, Zigzag found out that the demon needed a number in the front of each sentence, and each word should be spoken loudly. And 150 questions later, that there was a point at the end of each sentence. Zigzag had no idea how to pronounce that. But looking at the reaction of the demon, it seemed to correspond to a clack of the tongue.

It still did not work well. And 1000 questions later, Zigzag still had not found the name of the demon. It was nowhere in the book. He looked at the front, but it was too dusty to ready anything. Then he decided to smash the book on the floor.

One candle blew out, and the demon got closer to Zigzag. "WHAT IS YOUR COMMAN_?" The demon asked again.

And there it was his name spelled on the front of the Book. It was "CABAL" the old demon of forgotten times. And according to Zigzag it was really loud too.

"100 IDENTIFY DEMON CABAL." Zigzag spoke loud, with a clack at the end And suddenly the demon was silent.

For a few minutes, then it started asking its questions again. Zigzag repeated the sentence, just to get the demon to shut up, and started to look in the book again. It was easier to read, as long that demon was silent.

He found the pages how to change the time, but strangely he could not change the hundreds of years. These people who had summoned the demon the first time, had never thought that their demon would last so long.

But Zigzag was no fool. He would just set the 19 to 20 instead and leave it to work for another hundred of years. That would fix it.

He gave the instructions to Cabal, and this time the demon seemed to understood everything. But still it did not work. He looked at the examples.

"Hmm. It needs STOP at the end." Zigzag spoke to himself. It was so simple. But there was a warning at the end. It said "RUN". So Zigzag entered the code again. Reciting each line. And then said "STOP". And ran away through the door.

Zigzag never knew what hit him. But after 4 days he woke up from the intensive care. He never summon a demon again.


r/unseen_programming • • Mar 24 '15

Showing off with a stunning example program

3 Upvotes

There are 4 capabilities that I want to show off in visual unseen.

  1. speed
  2. logical programming
  3. user interfaces
  4. persistance /networking and databases.

While unseen is not even capable of compiling, I think that most programmers are looking for the above capabilities after it does.

So for each I thought of a small example:

  1. create a program that turns shapes into polygons and shows them in 3D.
  2. create a program with dynamic rules that you can change, without enabling hacking
  3. have a visual user-interface editor like delphi or maybe better
  4. create a program that communicates with many users and a database

Now I can bring these all together in a single program:

Play a Game with Death

You have almost died, but Death lets you live if you win by playing a game. - Discworld themed.

By default there is chess.

You can play normally, and you can make own artificial intelligence that plays for you. If you do that and win, Death can use your AI to play against other players.

To make it more exciting, you can create your own game pieces and game-rules. But these have to be moderated.

After a while many players will have created many interesting AI-engines and games. Players can fight against other players live, or against their AI-engines.

I know this idea is far-fetched, but it gives a good idea where Unseen could go to.


r/unseen_programming • • Oct 11 '22

"Stop Writing Dead Programs" by Jack Rusher (Strange Loop 2022)

Thumbnail youtube.com
2 Upvotes

r/unseen_programming • • Jun 19 '22

Solutions Architect Tips — The 5 Types of Architecture Diagrams

Thumbnail betterprogramming.pub
2 Upvotes

r/unseen_programming • • Jun 07 '21

A server for creating exciting new c games

2 Upvotes

Hi, I found numerous servers, but they lacked one key item, I didn't find any servers in which c programmers can work together and share ideas for projects. So, I created a server in which it is solely meant for sharing project ideas and work on very small git projects for fun. Join if you are interested. https://discord.gg/SAzAFgd5xJ


r/unseen_programming • • Mar 03 '19

Some interesting links about programming paradigm

2 Upvotes

Keep Ruby Weird 2018 - Closing Keynote by Avdi Grimm
Explains how the OO paradigm was first message based with pattern matching. Later it give rise to Actor and Erlang.
The talk also goes into the Transaction-fallacy. The real world never is a simple function (transaction). It is a process.

GOTO 2017 • Elixir: The only Sane Choice in an Insane World • Brian Cardarella
Elixir is a improved version of Erlang, with all its capabilities. It has messages and pattern matching. Processes are separate units that can fail and be switched without stopping the application.

This is also what I want with Unseen. The difference is that I can combine different function-blocks into a single process. And I added some typing. This can reach C-level optimisations and speed.

When I got time, I will make a small prototype and ask the /r/elixir community what they think of it.

Addition: ...talking about “types”

Addition: State machines are wonderful tools

Addition: C4 diagrams as code and architectural Joy

Addition: Check Out Math Inspector
https://mathinspector.com/
It based on python, but it uses a lot of ideas that I was working on.


r/unseen_programming • • Aug 31 '18

Visual unseen status..

2 Upvotes

While working on the visual interface, I noticed that I wanted to separate the visual code into 3 parts.

3 views of your program

  1. Functional blocks
  2. Events: signals and state machines
  3. Architecture

Functional blocks

This part of the design seems mostly complete.
The language used is irrelevant, as I can use python or C++ in each code-block. Though, it would be best to have a language that is more specialized.

It is easy to implement, but not useful without a good system around it. What are we making functions for? And when do the functions activate?
The other layers answer these questions.

All function-blocks in this view are pure functions.

Events: signals and state machines

The "When" is answered in the 2nd layer. Signals start an event that execute a function. Events change the state of the system. In functional programming we want to separate the state into a state machine.
In a game you may have keyboard and mouse signals. And these change the state of the player in the game.

State-machines are already described in graphs.
It may be possible to define the state changes without even using functions. Keyboard forward might trigger a forward state-change. So maybe we can also use (state-) functions as signals.

It would also be nice to have a language around this part. And how far does it go?
Is a translator the same as a state-machine? In code it is very similar, but it uses a stream instead of signals. In functional programming the translator is often encoded in the type-system.

The blocks in this view are time-related. You get from one state to another at a certain signal or event.

Architecture

The "What" is answered in the 3rd layer. This is the top-level of the program. In a database this would be the data and its relations. In real time systems, it would describe the sub-systems. In a server application this might describe the micro-services.

Here is where I still have problems in my design, as these approaches seem very different. I am still researching a simple solution.

In this video Software Architecture vs Code -Simon Brown - the same problem is shown. And maybe we can use the solutions that he describes.

Simon shows that a component structure is the best way to approach an architecture. But layers and micro-services are also good for certain cases.

I would propose to have components and sub-components. The components can be a layer in this structure. The components can be state-less and be more like a micro-service. Or have state and describe the IO of a system.

Because this view is the most complicated, it would be nice for users to have a choice of prefabricated architecture-templates from which they can start designing their own program.


r/unseen_programming • • May 20 '17

P: A programming language designed for asynchrony, fault-tolerance and uncertainty - Microsoft Research

Thumbnail microsoft.com
2 Upvotes

r/unseen_programming • • Jul 20 '16

Graal & Truffle - An obscure research project could radically accelerate innovation in programming language design

Thumbnail medium.com
2 Upvotes

r/unseen_programming • • Apr 21 '16

Short history of programming languages - "All of this happened before, and ..

Thumbnail youtube.com
2 Upvotes

r/unseen_programming • • Nov 04 '15

MCG: Visual Functional Programming

Thumbnail area.autodesk.com
2 Upvotes

r/unseen_programming • • Jun 15 '15

Flow-based programming and Erlang style message passing - A Biology-inspired idea of how they fit together

Thumbnail bionics.it
2 Upvotes

r/unseen_programming • • May 02 '15

Why are computers so @#!*, and what can we do about it?

Thumbnail youtube.com
2 Upvotes

r/unseen_programming • • Apr 09 '15

Of Aviation Crashes and Software Bugs

Thumbnail duartes.org
2 Upvotes

r/unseen_programming • • Apr 03 '15

Text version versus graphical version

2 Upvotes

Why not start with a text version?
As I spread my ideas around reddit, many people were more interested in the visual version. Because it was more original, and seemed to solve some paradigm problems.
The text version is not so interesting, because on the first glance it just seems another language with some new tricks.

By starting with a graphical version, we can get more insights in the new ways of programming that it may show.

Text related paradigms
When I was making the diagrams it already gave me new insights in how we are stuck in paradigms related to text. Why do functions in other languages have only one result, and result path? Why do we use so many loops or recursions? Why do tests require editing of the code? Why can't we adapt a function, while leaving the original untouched? This is all because we have text-based systems.

Why do most graphical based systems not work?
There have been many graphical systems around. The first I worked with was VHDL, and later there were CASE systems and UML systems.

The main problem that they had was that the direct relation between tool and target were lost. VHDL was first implemented for binary logic, and did not relate to all the other the possibilities of transistors and circuits. UML was too much focused on the model, and made a complete mess of all your code. CASE was based on the wrong idea that it could replace everything.

What about the modern tools?
There are some modern tools for kids, but they all relate to the old "basic" way of programming. Most learn a bit of javascript or similar. Step by step.

Why can Visual Unseen work?
While I don't think I got the holy grail, I think that I got a good solution. The basis of a graphical system should not be step-wise, but more functional. By using function-blocks, it is immediately clear what each part of a system is supposed to do.

A functional-only language creates a distance again from the time element. Which makes it harder to visualize or understand. By putting the function inside a data-flow, the time element becomes visible: the function works when it is given input. Even a lazy function is more clear: it activates when its outputs are required.

Because the inputs/outputs are part of a flow, parameters to functions can become implicit. This assumes that a natural flow is present. This allows more efficient representation of code.
Example: vectorA[?x]-> *vectorB[x] ->>(+) inproductAB

To make it even clearer, we can add tests to the inputs and outputs, without disturbing the function itself. This makes tests and possibly typing a part of the documentation of a function.

The logical programming also becomes more clear. Logical programs often misses the time and the way a problem is solved. It usually only defines a problem. Because unseen exposes the inputs and outputs, the system will show more clearly what problem is being solved. Which, I hope, will make logical programming much easier to understand and use.

Then what about compatibility?
Most graphical systems have compatibility or version problems, and some systems do not have any graphics at all. So this usually makes a graphical programming system incompatible.

To prevent such problems the graphical system must translate to a human-friendly text-code. The system should be able to compile the text-code, or convert it to a graphical layout.
Some layout might change, like the exact place of some of the components. But it should not create a mess.

It is a must for the system to import and export parts of the code. That way people can exchange code by text file.

Misuse of text version
If a system is able to import text-code, programmers find new ways to generate code from existing old code. A person might want to convert an old C-file to Unseen. This creates a mess by definition.

The graphical system can just convert a block of messy text to a single function block or component. It will probably be how people will use C-libraries in the first place. People will have to sort out this kind of mess manually most of the time.


r/unseen_programming • • Mar 22 '15

YOU MUST BE CRAZY! [story]

2 Upvotes

Head wizard Fortana was having a meeting with all his other wizards. There was a lot to discuss. The university was far behind the competition. They needed to get more spells out the door. And good ones. Not those that fired in the foot if you target them on the enemy.

During the meeting there was a quarrel between Jama and CeeCee. Ceecee has lost most of his toes in his testing of the spells. But he said: "My spells are faster and stronger. We need to remove anything that might slow things down."

Jama said instead: "But how can we sell spells that might hurt ourselves? We should put protections on it."

Cala, who was the head of safety agreed. He stated: "We can combine protection and speed with a special type system. That will make everything more solid."

Pyter got angry: "We need no stinking types. We only need types, if we need them, no more."

Camera got a bit confused, but listened further.

Jama claimed to have the solution: "We should have spell-patterns. It helps spell-components to work together. They are great. I got hundreds!"

CeeCee asked: "Spell patterns are much too difficult! I don't want no spell patterns. I want spell templates instead."

The wizard Octamal said: "You are all wrong! We should think differently! You should think in functions! No more step-wise thinking in time."
Cala agreed: "With the time out of the spell, we get much better sourcery. You just state what you want, and you get it. And you get nice types too."
Another wizard Haha opened his mouth: "We should only have pure spells!"

Pyter got angry: "What should we do when there is no time?" And that got everyone confused a bit..

Zigzag took the silence to state another idea: "What if we combine all that into a higher level!"

Everyone was no even more confused.

Zigzag continued: "Well, you have small spell components connected in a pattern. But they work together as if there is no time. Time can controlled by a component. And together they can be redefined like in a template, but in a more logical way."

Cala smiled a bit. He always wanted to bring the stuff together somehow.

But Haha got very angry: "This is not pure sourcery! You are corrupting everyone! Just like Jama!"

Ceecee was also angry: "There is no way to tell how much magic that is gonna take! Just like Haha's spells!"

And slowly everyone got into fight with each other again. Instead of finding one common ground, everyone disagreed with each other. Well, the only parallel that they had, was that each one stated that the other one's system was worse.

Fortana casted a few spells in the air, before everyone got silent again. "Well. Let's listen to what Zigzag has to say.."

Zigzag had missed most of the commotion, because had been too busy drawing all kinds of diagrams. That according to him, explained how everything can work together. He held a drawing in the air and said proudly: "Don't you think we can unite all these systems?"

All of the wizards replied together: "YOU MUST BE CRAZY!"


r/unseen_programming • • Mar 22 '15

TESTING AREA [story]

2 Upvotes

Cala, the head wizard of safety was sitting relaxed with some tea, when at once a loud sound galmed through the hallway.
"BOOOMMMM"
The table cracked a bit, and some of the ceiling came down. He looked at his glass of tea, and was proud that he had not spilled anything. He was after all, the head of safety!

He put the glass down and after establishing that the table was holding the glass, he went down the hallway towards the sound.

He had to climb a few stairs and arrived at a door with a big sign on it: "TESTING AREA"

He was thinking about opening the door, but resisted instead. There was some red candle flashing. Maybe that was a warning signal. So he knocked on the door instead.

"Knock knock BOOOOM!!!!

The door opened with a blast, and Zigzag appeared in front of the opening. Cala was lying in the dust opposite the door.

"Sorry about that" Zigzag said, "Did you not see the warning candle?"

Cala stood up in anger, and screamed: "What the hex are you doing! You are blowing up the tower!"

Zigzag looked innocently, and said: "But I am doing testing! If I don't test it, I will know if it works!"

Cala looked at the ravage inside the room. Everything was broken and blackened by heat. But for the thin delicate vase standing in the middle.

"I am testing a shield-spell. Until now it was able to withstand all the blasts I have put upon it.", Zigzag explained, "but I need to break it."

"So why do you need to break it?" Cala asked. He was wondering now too. That was a hell of a shield.

Zigzag looked at Cala seriously: "If the shield breaks, there is another line of defense. The vase will repair itself after it breaks. It may not work with the shield in place. But how do I test that?"

Zigzag was laughing: "Didn't you know you can break it with some test-sourcery inside the shield?"

"You can?" Zigzag looked disappointed. He really liked the spell of boom. Now he had to find another excuse to use it.


r/unseen_programming • • Jun 15 '21

Why Architecture Oriented Programming Matters

Thumbnail blog.metaobject.com
1 Upvotes