osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

python 2 to 3 converter


Chris Angelico wrote:
> On Tue, Dec 10, 2019 at 4:41 PM songbird <songbird at anthive.com> wrote:
>>
>> Chris Angelico wrote:
>> ...
>> > What if neither works, because there are assumptions that don't work?
>>
>>   then you get stuck doing it by hand, but you would have
>> been stuck doing it before for sure by hand so if you can
>> write something which might get some of the easy cases
>> done then at least you're saving your efforts for the
>> harder stuff.
>
> The easy cases are easy for anything, and don't need AI.

  i consider calling a statistical approach to conversion
"AI" is like calling snobol AI.  it is pattern matching
and applying tests to see what happens.  that's all, it
might even be brute forced.


>> > I get the very strong impression that you've never tried this.
>>
>>   of course not!  i don't have that kind of pipeline
>> or machine power and i'm several years away from being
>> where i'd like to be in terms of understanding the
>> language itself.  i hope to have the time over the
>> next few years to learn enough but i don't know how
>> that will go.
>>
>>   i'm glad in looking around more the past few evenings
>> that the conversion effort is making progress and
>> things are not as dire as some have made it out to be.
>> i just hope the lessons have been learned going
>> forwards.
>
> Never even done it manually, I mean. It's very difficult to try to
> design an AI to do something that you can't do yourself and don't even
> understand the problem.

  for me it would be a way of learning python 2 and python
3 better.  i have enough understanding of how compilers 
work so those parts of the project wouldn't be scary to me
at all.  the statistical aspects i'd need help with and
the generating of tests and how to run them would be new
to me.  but that tests already exist and that they are 
intended to be simple bits of code should be a goldmine 
for conversion scripts to look at IMHO.  so perhaps 
someone who's facing a huge conversion problem might find
this as a worthwhile thing to ponder.

  personally, if i were working again full time and 
facing several million lines of code and a lot of 
recalcitrant workers, well, i'd be stuck trying to do
something to get it done.

  i have gone through conversions before (a major one
at a university where we went from an inhouse system to
a vendor supplied system).  we didn't do the conversion
automatically and it didn't happen overnight, but it did
get done on schedule and i think we also came in under
budget.  i was only part of the team involved as a
general systems person as i still supported the mainframe
we were coming off of to go to the mini but for the new
system i worked with all the conversion efforts going on
in the departments along with any interface issues to 
the printers, how to run jobs in sequence, scanning 
grades, ...).  i pretty much did whatever was needed.
when the conversion was winding down was a good point
for me to retire/quit as i'd been doing nothing but
going to school and programming or working with computers
for 15yrs.  right before the internet took off...

  my own local conversion effort recently was my small
website setup where the theme author had introduced a
lot of breaking changes over several years and no 
conversion utility so i wrote one in a few days.  it 
saved me a few weeks of converting it all by hand (and 
i've posted it to github so anyone else stuck in the 
same spot at least has a workable framework to go from).
no, it's not AI or complex enough to be considered all
that interesting but it worked and saved me enough time 
that i can start looking at python 3 again.


  songbird