factorpy, what is it?

Posted on July 18, 2019 by rctcwyvrn

What is factorpy?

Factorpy is an interpreted language with a unique syntax and python interoperability.

An example of factorpy code:

factory factorial(){

	let x = in

	x -> sub1() -> factorial() -> *()

	x -> *() -> out

}

Factorpy code defines what goes into a function and where it’s output should go. So in this example the programmer wants the input to the factorial() factory to be used twice, once as an input to the sub1() factory, which sends it’s output to a new factorial() factory which sends it’s output to the multiplication function. This looks (and to be honest is) stupid and complex.

Why?

Factorpy was made with 0 goals in mind, but as I wrote it I thought of what it may be used for, and the main one was to help new programmers. Factorpy solves one and only one of the problems some newcomers to coding may have, the control flow. We as programmers intuitively understand that code is run one command at a time, but to a newcomer this may be unintuitive. The solution is to have code run concurrently, much like a real world assembly line.

This is all of course an excuse for me to mess around with writing a programming language. I think it’s quite cool but I don’t want to bother trying to justify it’s existence. It’s a fun side project and should be treated as such. More esolang than innovative new programming paradigm.

Other important details about factorpy

  1. You can import python functions and (in the future) just write straight python to define factories in factorpy files
  2. As mentioned earlier, the code runs concurrent by default, ie every function tries to run and will simply wait if there is no input.
  3. The current interpreter is a mess and should be used with caution

Who?

Factorpy is a personal project of mine, it’s current state is a giant mess of spaghetti python code and terrible hacks. But it kinda works! Note that in the example above there is no base case, that would be because I haven’t figured out how to do that just yet. Note #2, the above code does not run on the current compiler, as it does not support recursion yet.