crazy programming language thoughts

Ryan Lowe ryanlowe0 at msn.com
Fri Aug 29 19:29:38 EDT 2003


"Sean Ross" <sross at connectmail.carleton.ca> wrote in message
news:35y3b.3262$_F1.545316 at news20.bellglobal.com...
> "Ryan Lowe" <ryanlowe0 at msn.com> wrote in message
> news:3rv3b.6241$yg.2305230 at news4.srv.hcvlny.cv.net...
> > what i am attempting to figure out, is if there is
> > a way to improve the intuitiveness of the python's syntax, specifically
> > concerning functions.
>
> Hi. I'm pretty sure you will not find a lot of support in this forum for
> changing
> Python in the way that your hoping. You're pretty much proposing a new
> language, not just enhancements for an existing one.  But, whatever ...

im not trying to change python. even a small change is a tough sell with
this crowd ;-) i guess i should have labeled this off-topic. is there a
forum that might be more appropriate?

actually, i would like to make my own language, sort of. what id like to do
is compile to regular old python code, instead of directly to executable.
that way i wont have to reinvent the wheel for the parts of python i would
keep in my new language (which is a lot), as well as all the libraries and
such. maybe ill find this will become too difficult, but what the hell, i
ought to learn a thing or two in the process.

> Personally, I really like the *idea* of an english-like programming
> language -
> I'd like to make one myself, and I think it'd be a fine toy for simple
> scripting.
> However, I also think it would become cumbersome as the scale of your
> projects grew.  Heck, it's cumbersome even when your projects are small.
> English is not always the most concise way to say something, nor is it
> always the most clear. Take the following Applescript code for example:
>
> What is the result of each of these statements:
>
> words from paragraph 2 to paragraph 4
> words of paragraphs 2 thru 4
> text from paragraph 2 to paragraph 4
> text of paragraphs from 2 to 4
>
> They're all different.

thats interesting. thats pretty much the impression i got from applescript.
i think it goes too far trying to be english-like to the point of
obfuscation. i see no need to english-ify selecting a range of things from a
list.
id do something like:

 get words in paragraphs[2 : 4]

where paragraphs is a list of strings each containing a paragraph of text
and "get words in _" is a function call and the *only* form it can be
written (in verb form, that is; in noun form the only way would be "words
got in _").

so i can dodge this bullet, but running into the type of problem in this
example is exactly what im concerned with. as it stands, i dont think the
difference between my way and python's way is as different as between my way
and applescripts.' i use function calls just like python, only they span
multiple words with the args interspersed instead of bunched up at the end.

part of my motivation for attempting this comes from my ongoing struggle to
understand functional programming, which goes to the extreme of putting
functions/operators in the wrong place vis a vis the arguments. so i guess
my main point in asking here was to see if people with more oo and/or
functional lang knowledge can find where/if my model breaks down. because,
id like to build much more than a "toy" language.

> The answers can be found here:
> http://www.applescriptsourcebook.com/tips/gotchas/ranges.html
>
>
> > do you think it would confuse people in terms of which part is a
parameter
> > of what when combining 2 functions like the combo example?
>
>
> In Applescript, you can (optionally) use parenthesis to (attempt to)
> disambiguate. So,  for example, in your case, doing something like
>
>         replace av with bv in (listv joined with gluev)
>
> might make things a bit clearer.

sure thats the obvious solution. it would suck (just a little) if every
expression-argument needed parens, while the comma and single outer parens
work in traditional functions, but thats minor.

> >  i havent figured out how to de-dottify class functions and class
> > attributes.
>
> Well, you could do something like this (applescript-like, again):
>
> -- If you have an instance of the class
> set the attribute of instance's class to value
>
> -- or
> set the attribute of the class of instance to value
>
> -- or, maybe even,
> get the attribute of instance's class
> set it to value
>
>
> -- And, if you don't have an instance, or you just want to get there
> directly
> set className's attribute to value

or just
attribute of classInstanceVar = value

the 'of' works like the dot only in front. may conceivably cause problems if
functions have ofs in them, but since it works on the front while other
function words go behind, i think its resolvable.

can anyone think of something you couldnt do with this, that you can in
python? i know applescript is limited, but does my language suffer from
similar challenges? any functions that would translate to a simple
verb-noun-args and other words setup?

>
> Anyway. It's an interesting idea (your language) - not a new idea, but an
> interesting one. If you want to play around with something very much like
> Applescript, but you don't have a Mac, you can get a trial version of
> MetaCard (www.metacard.com). And, if you really want to make your own
> language, you could use SPARK, as a start,  to whip up a (slow) prototype
> to mess around with and see how things should go together. As for getting
> Python to _become_ your language ... well, good luck with that.
>
> Sean

SPARK, huh. never heard of it, ill check it out. thanks







More information about the Python-list mailing list