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


Groups > comp.lang.python > #19819

Re: SnakeScript? (CoffeeScript for Python)

References <21293604.477.1328191753730.JavaMail.geo-discussion-forums@vbbfd4> <CAL7_Mo-b6F7moEvK9BkvCqNb7GOZJmEaVb6u3Mi-CaboFpxhiw@mail.gmail.com> <CAF_E5JbBdZuNRyUbEKBkrac5dVEQQtpAq=1B1HwL8QuL3q+TcQ@mail.gmail.com>
Date 2012-02-03 13:51 +1100
Subject Re: SnakeScript? (CoffeeScript for Python)
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5387.1328237512.27778.python-list@python.org> (permalink)

Show all headers | 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