Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to port to Python ? #5

Open
luzpaz opened this issue Jul 9, 2023 · 5 comments
Open

Any plans to port to Python ? #5

luzpaz opened this issue Jul 9, 2023 · 5 comments

Comments

@luzpaz
Copy link

luzpaz commented Jul 9, 2023

Perl is awesome. The issue is the need to support the perl interpreter as a 3rd party dependency.

Thanks for the amazing work on this!

@brunopostle
Copy link
Owner

I started writing it in python, but realised I needed some advanced regular expression stuff that I knew how to do in perl.

ifcmerge isn't very complex, I'm sure it can be rewritten in python, contributions welcome.

Though importantly git requires that a mergetool is an executable, so on Windows it needs to be an EXE file (which I can do with perl, not sure about python). The Perl version doesn't have any dependencies, so it will run on any machine with perl, ie. Linux and OSX, without any problems.

@luzpaz
Copy link
Author

luzpaz commented Jul 9, 2023

Thanks for the reply. Perl does indeed have some awesome regex functionality.

Just a quick search returns https://www.tomshardware.com/how-to/create-python-executable-applications
(Note: I don't have experience with it)

@Martin15135215
Copy link

I have had some experience with pyinstaller, the only disadvantage I see is that the exe can get a very large file size, since it just an script with the whole python interpreter and all the deps in one file...

PyInstaller reads a Python script written by you. It analyzes your code to discover every other module and library your script needs in order to execute. Then it collects copies of all those files – including the active Python interpreter! – and puts them with your script in a single folder, or optionally in a single executable file.

Source: https://pyinstaller.org/en/stable/operating-mode.html

@Martin15135215
Copy link

@brunopostle Did you use the standard module re

This module provides regular expression matching operations similar to those found in Perl.

Source: https://docs.python.org/3/library/re.html

I don't know any perl, however i learnt doing regex with the re module with this beginner tutorial https://automatetheboringstuff.com/2e/chapter7/

That might help

@brunopostle
Copy link
Owner

It looks like there is no significant difference between installing a perl or python version (the current windows EXE bundles a perl interpreter just as a python version would need to bundle a python interpreter).

Python is much better understood by people who might want to work on these tools, so switching would be a good thing, but somebody would need to contribute this (and check it is as fast, perl text handling is very efficient).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants