isaacg1 / pyth

Pyth, an extremely concise language. Try it here:
https://pyth.herokuapp.com/
MIT License
262 stars 57 forks source link

Pyth 5 #111

Open orlp opened 9 years ago

orlp commented 9 years ago

I'm working on a clean-sheet rewrite of Pyth (calling it Pyth 5 for now). Things I'm working on are:

My personal candidates that require a good hard look to see if we really want to keep them, or maybe swap less favourable with more favourable names:

Ideally we'd hold some sort of voting system where we reassign better mnenomics and revalue all functions. Some of the new . functions have shown to be incredibly useful, and some of the single-character functionality proves almost entirely useless.

Other ideas/problems to consider:

Maltysen commented 9 years ago

This this seems really cool. I just disagree in the A, its pretty useful and saved me a char quite a few times with expanding the input into two vars. Im also concerned about the tuples leaving only because of being able to splat the input into U. Everything else seems fine.

refi64 commented 9 years ago

Can't , still be used be used for tuples? I just used it recently to save 2 chars.

Maltysen commented 9 years ago

@kirbyfan64 I think that will then be instead used to create a two element list instead.

jakobkogler commented 9 years ago

Pretty much agreeing with most of your points.

Just a few thoughts:

orlp commented 9 years ago

@Maltysen @kirbyfan64

The plan is to purge tuples entirely, so , would indeed be a two element list.

orlp commented 9 years ago

@jakobkogler

I definitely do not like removing dicts entirely. gmpy2 would strictly be an implementation optional detail optimization - if you don't have it installed you'll only lose some performance, nothing else.

My plans for rationals are a bit bigger. I'm actually thinking about having just one 'real' number type. It would be stored as a rational, and printed like a decimal number, with utility functions to get the numerator and denominator and to truncate. Functions taking for example an integer right now would truncate any real number passed in automatically.

isaacg1 commented 9 years ago

This seems really awesome.

On the subject of removing all tuples, one (small) advantage that tuples currently have is that They can be easily appended/prepended to lists. e.g. +[1 2)(1 2 = [1, 2, (1, 2)], whereas +[1 2)[1 2) = [1, 2, 1, 2]. We should make sure there's a way to do prepend and append with lists.

jakobkogler commented 9 years ago

Appening with a, prepending with +. Does work already. On May 16, 2015 5:14 AM, "isaacg1" notifications@github.com wrote:

This seems really awesome.

On the subject of removing all tuples, one (small) advantage that tuples currently have is that They can be easily appended/prepended to lists. e.g. +[1 2)(1 2 = [1, 2, (1, 2)], whereas +[1 2)[1 2) = [1, 2, 1, 2]. We should make sure there's a way to do prepend and append with lists.

— Reply to this email directly or view it on GitHub https://github.com/isaacg1/pyth/issues/111#issuecomment-102567124.

isaacg1 commented 9 years ago

@jakobkogler You can't prepend a list to a list, currently. +,1 2]1 = [(1, 2), 1], but +[1 2)]1 = [1, 2, 1].

jakobkogler commented 9 years ago

How about implicit for-loop variable? FYN instead of FNYN and FYFNb instead of FNYFbNb.

isaacg1 commented 9 years ago

Actually, we could do that in Pyth as is. We'd just have to switch V<seq> to iterate over the sequence instead of its range.

orlp commented 9 years ago

@isaacg1 I have some design considerations I'd like to discuss. I also invited you (and others are welcome of course) to a Pyth 5 stackexchange chat room.

A couple of points:

refi64 commented 9 years ago

The minute disadvantage is that for development you have to run either using a module (python3 -m pyth) or using pip install -e ..

You could always use setuptools and run python3 setup.py develop. That's what I usually do.

orlp commented 9 years ago

@kirbyfan64 That's equivalent, but pip3 has the advantage that you can uninstall using sudo pip3 uninstall pyth.

refi64 commented 9 years ago

@orlp But, if you're developing it, you probably don't want to uninstall it anyway!

orlp commented 9 years ago

I need everyone's opinion on these two issues:

If you're interested in Pyth 5 I suggest you follow the repository so I can get more rapid feedback :)