this post was submitted on 14 Mar 2024
1 points (100.0% liked)

Python

6233 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

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

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 6 months ago* (last edited 6 months ago) (1 children)

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: https://www.youtube.com/@letslearnwithbob

@[email protected]

[–] [email protected] 0 points 6 months ago (1 children)

Hmmm... Did you perhaps mention me by mistake?

[–] [email protected] 0 points 6 months ago

I sure did. Please apologies.

[–] [email protected] 0 points 6 months ago (2 children)

That title took me a minute to parse

[–] [email protected] 0 points 6 months ago

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

[–] [email protected] 0 points 6 months ago
[–] [email protected] 0 points 6 months ago (1 children)
[–] [email protected] 0 points 6 months ago (1 children)

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()?

[–] [email protected] 0 points 6 months ago

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?