Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19819

Re: SnakeScript? (CoffeeScript for Python)

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.04; '#include': 0.05; 'instance,': 0.05; 'subject:Python': 0.05; 'python': 0.08; 'structure.': 0.09; 'am,': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'processed': 0.15; 'syntax': 0.15; 'code),': 0.16; 'code?': 0.16; 'files).': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handy': 0.16; 'trivially': 0.16; 'wrote:': 0.16; 'language,': 0.17; 'source.': 0.18; 'written': 0.19; 'feb': 0.22; 'header:In- Reply-To:1': 0.22; 'code': 0.25; 'compiled': 0.25; 'code.': 0.26; 'fix': 0.27; 'asking': 0.27; 'message-id:@mail.gmail.com': 0.28; 'compile': 0.28; 'fri,': 0.30; '(so': 0.30; '(unless': 0.30; 'translator': 0.30; 'usually': 0.30; 'quite': 0.31; "i've": 0.31; 'correct': 0.31; 'source': 0.32; 'languages': 0.32; 'sort': 0.32; 'it.': 0.33; 'to:addr:python-list': 0.33; 'certain': 0.34; 'executable': 0.34; 'identical': 0.34; '(not': 0.34; 'something': 0.35; '(for': 0.35; 'similar': 0.36; 'two': 0.37; 'run': 0.37; 'but': 0.37; "there's": 0.37; 'received:google.com': 0.37; 'resulting': 0.38; 'some': 0.38; 'received:209.85': 0.38; 'think': 0.38; 'concepts': 0.38; 'why': 0.39; 'files': 0.39; 'received:209': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'your': 0.61; 'kind': 0.62; 'perfect': 0.64; 'here.': 0.64; 'become': 0.69; 'care': 0.70; 'quality': 0.74; "'em": 0.84; 'andrea': 0.84; 'source?': 0.84; 'template,': 0.84; 'technique': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Zb3cquHnfP5SWbQ8EcOUr38UFNBRVoXfG3xNcEgvIuo=; b=F3Tkt4VX2iRAJX07CpMW8Yl9JpDgaA5sbH44A/JnUgC8SsvCXPu42MMWyZXK56goOZ qKqNQcZiAsWn51Taj9Txp4uIDCCLZFnMRVmfMLKPcJmMMUaXVmMEKc12Q/PcXeyp5vkF OLEyIrUCoHi74R0vco2TgalyGbFIbVY/lLJew=
MIME-Version 1.0
In-Reply-To <CAF_E5JbBdZuNRyUbEKBkrac5dVEQQtpAq=1B1HwL8QuL3q+TcQ@mail.gmail.com>
References <21293604.477.1328191753730.JavaMail.geo-discussion-forums@vbbfd4> <CAL7_Mo-b6F7moEvK9BkvCqNb7GOZJmEaVb6u3Mi-CaboFpxhiw@mail.gmail.com> <CAF_E5JbBdZuNRyUbEKBkrac5dVEQQtpAq=1B1HwL8QuL3q+TcQ@mail.gmail.com>
Date Fri, 3 Feb 2012 13:51:49 +1100
Subject Re: SnakeScript? (CoffeeScript for Python)
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5387.1328237512.27778.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328237512 news.xs4all.nl 6844 [2001:888:2000:d::a6]:35855
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19819

Show key headers only | View raw


On Fri, Feb 3, 2012 at 9:53 AM, andrea crotti <andrea.crotti.0@gmail.com> wrote:
> Mm I don't think it's what the OP is asking (unless I misunderstood...).
> I think he wants to compile some syntax TO Python.
> But I don't really see why you would something like this (if not for fun).
>
> Then how are you going to maintain the code? Maintain the compiled
> code or the source? And proving that your translator is always correct
> I think it's quite a hard task too...

There's two similar concepts here.

1) Skeleton codegens. You do up some kind of template, run it through
a program, and get a ready-to-fill-in code structure. In this case,
you don't care so much about the translator's quality (if there's
bugs/limitations, you fix 'em after codegenning), and will maintain
the compiled code.

2) Compilation to Python. You write your program in some other
language, run it through a program, and get executable code out of it.
You want the translator to be perfect (so that you don't have to edit
the resulting code), and will maintain the original source.

I think the OP is looking for #2. I've used that sort of technique a
number of times (not with Python specifically, but with other
languages that lack certain handy features); usually the source is
trivially translateable into the output, with 99% of syntax identical
(for instance, one oft-wanted feature is a C-like #include - I've
written .php.m4 files that  get processed through M4 to become PHP
files).

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

SnakeScript? (CoffeeScript for Python) Michal Hantl <michal.hantl@gmail.com> - 2012-02-02 06:09 -0800
  Re: SnakeScript? (CoffeeScript for Python) Paul  Moore <p.f.moore@gmail.com> - 2012-02-02 08:30 -0800
    Re: SnakeScript? (CoffeeScript for Python) Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-02-02 12:12 -0500
    Re: SnakeScript? (CoffeeScript for Python) Michal Hantl <michal.hantl@gmail.com> - 2012-02-02 12:23 -0800
      Re: SnakeScript? (CoffeeScript for Python) "bruno.desthuilliers@gmail.com" <bruno.desthuilliers@gmail.com> - 2012-02-03 04:03 -0800
  Re: SnakeScript? (CoffeeScript for Python) andrea crotti <andrea.crotti.0@gmail.com> - 2012-02-02 22:53 +0000
  Re: SnakeScript? (CoffeeScript for Python) Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-02 18:19 -0700
    Re: SnakeScript? (CoffeeScript for Python) Matej Cepl <mcepl@redhat.com> - 2012-02-03 11:42 +0100
      Re: SnakeScript? (CoffeeScript for Python) alex23 <wuwei23@gmail.com> - 2012-02-06 19:52 -0800
  Re: SnakeScript? (CoffeeScript for Python) Chris Angelico <rosuav@gmail.com> - 2012-02-03 13:51 +1100
  Re: SnakeScript? (CoffeeScript for Python) Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-03 09:08 -0500
  Re: SnakeScript? (CoffeeScript for Python) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-02-03 11:20 -0500
  Re: SnakeScript? (CoffeeScript for Python) andrea crotti <andrea.crotti.0@gmail.com> - 2012-02-03 17:24 +0000

csiph-web