Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

READ-ONLY-MODE: PLEASE DO NOT POST NEW STUFF!
  New Forum: http://forum.puppylinux.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 12 Aug 2020, 08:49
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
compile essays to python
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
nosystemdthanks


Joined: 03 May 2018
Posts: 724

PostPosted: Tue 16 Jun 2020, 09:56    Post subject:  compile essays to python
Subject description: rhetorical programming language
 

this language was created in 7 hours to make a point about free culture.

it may only be relevant to people who support free software and who have argued for or against free cultural licenses for non-software works.

it converts arbitrary english essays (or other essays written in ascii) to python (2/pypy 2) code.

a hello world program:

Code:
%bbvahpbvaepbvalpbvalpbvaopibap vawpbvaopbvarpbvalpbbvadp


output:



richard stallmans "saying no to unjust computing even once is help":



"the right to read":



i realise these are not spectacular outputs. there is a clear screen command, and the language is not only "graphical"-- it also sets variables, lets you create loops, clear and append variables, do conditionals--

stallmans "the right to read" compiles to 29 kloc, the last dozen lines of which are:

Code:
    if locolour < 0: locolour = 7
    colour(locolour, 0)
    xy(locx, locy, locolour)
    for loop747 in range(figure('r', vars, 'n')):
        if locx > 0: locx -= 1
        xy(locx, locy, locolour)
    locolour -= 1
    if locolour < 0: locolour = 7
    colour(locolour, 0)
    vars['r'] = ''
    lutog = 0
    colour(7, 0)


here is a full "manual" of the language:

Code:
    # % turn on/off printing
    # @ quit program
    # a, A cycle colour backwards
    # b, B cycle colour
    # c, C copy next variable value to following character variable
    # d, D move down most recent variable value
    # e, E toggle print default upper/lower (starts lower)
    # f, F move to 1, 1
    # g, G get next character variable value
    # h, H append next variable value to following character variable
    # i, I set next variable to empty string
    # j, J fi
    # k, K if most recent variable value is true, do the following
    # l, L move left most recent variable value
    # m, M convert most recent value to uppercase
    # n, N convert most recent value to lowercase
    # o, O set next variable to 0
    # p, P print most recent variable value
    # q, Q exit loop early (limited)
    # r, R move right most recent variable value
    # s, S turn off print default case
    # t, T set next variable to random number 0 to 99
    # u, U move up most recent variable value
    # v, V set next letter to following character
    # w, W loop most recent variable value times
    # x, X mark end of loop
    # y, Y wait next value seconds
    # z, Z clear screen


cat saying-no-even-once.txt | ./diogenes.py > man.py ; pypy2 ./man.py

if you have python2 installed, you can use that instead of pypy:

cat saying-no-even-once.txt | python2 diogenes.py > man.py ; python2 ./man.py

as usual, this isnt really a zip file. just rename it without the .zip
diogenes.py.zip
Description 
zip

 Download 
Filename  diogenes.py.zip 
Filesize  11.26 KB 
Downloaded  21 Time(s) 

_________________
The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0302s ][ Queries: 13 (0.0062s) ][ GZIP on ]