Write Shell Out Comes Python (github.com)
from hardkorebob@programming.dev to python@programming.dev on 14 Mar 2024 06:19
https://programming.dev/post/11430104

korn shell wrapper that outputs python code: you write shell > out comes the snake

#python

threaded - newest

thebardingreen@lemmy.starlightkel.xyz on 14 Mar 2024 06:33 next collapse

But… why?

Capricorn@lemmy.today on 14 Mar 2024 06:45 collapse

I guess there are many benefits if subprocesses (usually written in C) are replaced with functions (usually wrapping C code). That way, you could run an entire OS scripts via Python, with sensible performance improvements.

BUT

Does this tool replace shell commands with python functions? Or does it just call many times subprocesses.run()?

mapto@lemmy.world on 15 Mar 2024 04:34 next collapse

I guess the answer at this point in time is: it allows you to define the function replacements that matter to you in pnk.lang. But if so, ksh is not a first choice for maintainable code.

So it boils down to: can it “transpile” (transpret rather) its own code?

hardkorebob@programming.dev on 24 Mar 2024 12:56 collapse

Im 4 levels deep into the abstractions if we could somehow have time to discuss. I have a discord server and the link is at reddit if you search for subreddit pnk. Im not sure atm if its ok to post links to other places.

hardkorebob@programming.dev on 24 Mar 2024 12:51 collapse

No replacing. Its a shortcut to printing Python code. I wrapped Python in Shell. Thats it. Makes tkinter gui dev a breeze for me. I can make apps faster than you and we can test it out. LOL as a fun experiment lets make a video of you and I typing the same app. You do it with your editor and I do it with pnk. So everyone can see exactly what I mean. I apologize I am not very good yet at expressing technical stuff with others. Been a lone wolf for a very long time. Just life.

Sibbo@sopuli.xyz on 14 Mar 2024 07:31 next collapse

That title took me a minute to parse

JohnAtl@fosstodon.org on 14 Mar 2024 10:31 next collapse

@Sibbo @hardkorebob @python

Let’s eat grandma!

hardkorebob@programming.dev on 24 Mar 2024 18:38 collapse

Let’s eat grandma!

Music or Resume writing?

WDYM?

mapto@lemmy.world on 15 Mar 2024 04:31 collapse

Even looking into the readme and pink.lang, I’m still unsure what this does. I can imagine, but one single example would be nice. Bonus points if it is actually something useful

hardkorebob@programming.dev on 24 Mar 2024 12:42 next collapse

Apologies for the late replies.

Hello all. I’m new. I am not an “engineer” and don’t have a degree. 40 y/o Jack of all trades here and at the moment, I am an undertaker that removes your loved ones and transports them.

I created pnk.lang, shell functions, after having a hard time with Python. This is not a transpiler. I used the wrong term. BTW Bash can run this, as an up front tidbit. I chose ksh for the letter k and IBM uses it too. And my opinion is, there is no issue writing shell code for personal use. This can be made industrial-strength if the $ is right. ;)

You write shell functions that use its arguments to print Python as output. Simple! Save time and typing. Try it out!

I have [0] videos. The instructions on the readme on github explain how to launch the program newide. I can change the instructions if Im not clear. I tend to be terse and write like I speak in real life.

Good day, Bob

0: www.youtube.com/@letslearnwithbob

Martineski@lemmy.dbzer0.com on 24 Mar 2024 16:34 collapse

Hmmm… Did you perhaps mention me by mistake?

hardkorebob@programming.dev on 24 Mar 2024 17:35 collapse

I sure did. Please apologies.

hardkorebob@programming.dev on 24 Mar 2024 15:31 collapse

Here is a better demo

youtu.be/2nCvDFlGVQk