Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'elif': 0.05; 'expressions': 0.07; 'nested': 0.07; 'subject:code': 0.07; 'executed': 0.09; 'executes': 0.09; 'experimental': 0.09; 'msg': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'ron': 0.09; 'url:github': 0.09; 'api': 0.11; 'python': 0.11; 'def': 0.12; 'project,': 0.12; '"\\n")': 0.16; '"good': 0.16; '"guess': 0.16; '"hello': 0.16; '(int': 0.16; "(it's": 0.16; 'block.': 0.16; 'blocks': 0.16; 'executed.': 0.16; 'msg)': 0.16; 'picks': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:object': 0.16; ':-)': 0.16; 'language': 0.16; '(not': 0.18; 'bit': 0.19; 'first.': 0.19; "python's": 0.19; 'later': 0.20; 'written': 0.21; 'help.': 0.21; 'command': 0.22; 'tests': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'byte': 0.24; 'replace': 0.24; 'skip:{ 20': 0.24; 'fairly': 0.24; 'cheers,': 0.24; 'looks': 0.24; '(or': 0.24; "i've": 0.25; 'script': 0.25; 'compiled': 0.26; 'possibly': 0.26; 'header:X-Complaints-To:1': 0.27; 'idea': 0.28; 'skip:- 40': 0.29; 'wondering': 0.29; 'possibility': 0.29; 'converting': 0.30; 'returned': 0.30; "i'm": 0.30; 'code': 0.31; 'too.': 0.31; 'url:wiki': 0.31; 'subject:other': 0.31; 'anyone': 0.31; 'lists': 0.32; 'another': 0.32; 'quite': 0.32; 'open': 0.33; 'worked': 0.33; 'alone': 0.33; 'guess': 0.33; 'implemented': 0.33; 'projects.': 0.33; 'subject:with': 0.35; 'form.': 0.35; 'objects': 0.35; 'test': 0.35; 'there': 0.35; 'version': 0.36; 'combination': 0.36; 'in.': 0.36; 'module.': 0.36; 'scheme': 0.36; 'possible': 0.36; 'should': 0.36; 'behind': 0.37; 'too': 0.37; 'project': 0.37; 'clear': 0.37; 'bringing': 0.38; 'lists.': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'users': 0.40; 'how': 0.40; 'around.': 0.60; 'catch': 0.60; 'most': 0.60; 'subject: ': 0.61; 'course': 0.61; 'simple': 0.61; 'first': 0.61; 'back': 0.62; 'decided': 0.64; 'became': 0.64; 'stand': 0.64; 'world': 0.66; 'header:Reply-To:1': 0.67; 'improvements': 0.68; 'helping': 0.70; 'reply-to:no real name:2**0': 0.71; 'hoping': 0.75; 'reply- to:addr:gmail.com': 0.80; '"too': 0.84; '(print': 0.84; '10:': 0.84; 'experiment': 0.84; 'forward.': 0.84; 'high,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ron Adam Subject: An experiment with blocks of object code and other meta ideas. Date: Mon, 27 Apr 2015 19:55:10 -0400 Reply-To: ron3200@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ip98-170-222-96.pn.at.cox.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 120 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430178926 news.xs4all.nl 2925 [2001:888:2000:d::a6]:44322 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89471 I've been playing around with a experimental script language that executes object code lists directly and am looking for others who might like to help. The first version was written in python. The original idea came from wondering if it is possible to replace python's byte code with nested object code lists. As I worked on it, it became clear it would also make a nice script language on it's own so I decided to test how it would work independently of python first. Currently it's implemented in scheme so it can be compiled to C and a stand alone executable. The design is simple enough that converting it to use python objects and using the python C API should be fairly straight forward. I can update the original written-in-python version if anyone is interested. It's quite a bit behind the scheme version right now. It might make an interesting module. Here's a few command line examples... ==> def [hello] [ ... (print "Hello World\n") ... ] ==> (hello) Hello World ==> set a 23/41 ==> set b 3/2 ==> (+ a b) 169/82 ==> for x [1 2 3 4 5] [ ... (print x "\n") ... ] 1 2 3 4 5 ==> set conds [ ... (< a 6) ... (== b 2) ... not-done ... ] ==> let [a b not-done] [7 2 0] ==> (or conds) 1 ==> (and conds) 0 And of course it does execute files too. :-) {-------------------------- guess-my-number.mta GUESS MY NUMBER GAME The computer picks a number and you try to guess it. -----------------------------------------------} def [guess] [ set n (random 10) set msg "Guess a number from 0 to 10: " loop [ (print msg) catch error [set g (int (read-line))] if (not (empty? error)) [set msg "What?, guess again: "] elif (> g n) [set msg "Too high, guess again: "] elif (< g n) [set msg "Too low, guess again: "] else [break] ] (print "Good guess!\n") ] (guess) I've been told it looks like a combination of scheme, tcl, and python. This script-language tests a number of ideas I've been interested in. Keywords are objects too! They can be bound to names and executed later in another place or returned by expressions to be executed. Blocks are nested lists of object code that can be passed around. Actually programs are nested lists of object codes. It's just the outer most block. These features make it an interesting meta language to experiment with. If you think you may be interested in helping with this project, (It's open source), you can find it here. https://github.com/Ronald-Adam/magic-meta https://github.com/Ronald-Adam/magic-meta/wiki/1.-Home I'm hoping some of you may be interested in helping out as a group project with the possibility of bringing some of the ideas back to python in some form. Possibly as a script language that can be used in projects. There is lots of opportunities to make improvements and additions as there are zero users currently. It's still very early in it's development, so don't expect too much at this time. Cheers, Ron