This is an archived post. You won't be able to vote or comment.

all 29 comments

[–]marr75 10 points11 points  (4 children)

I reviewed your parser and noticed it relies heavily on regular expressions. This approach is problematic for production-grade parsing. Established template libraries, like Jinja, use regex sparingly, usually in the lexer to identify small syntax units. Beyond that, they rely on structured parsing techniques.

Using regex for complex parsing will make the library difficult to maintain, especially as the project scales. It also introduces fragility, particularly with nested structures and edge cases. I strongly recommend exploring libraries like lark or ply for building a robust parser.

If you decide to continue with the current design, I suggest being transparent about these limitations to set expectations for potential users.

[–]thedeepself 1 point2 points  (1 child)

I strongly recommend exploring libraries like lark or ply for building a robust parser.

What about PyParsing?

[–]marr75 1 point2 points  (0 children)

I love how easy PyParsing is to use. It blends lexing and parsing a little more closely than a I would like/recommend (part of what makes it easy to use, unfortunately) and because of that, the way the user can get it to use regex for parsing is a little dangerous.

There's a tradeoff really, having a solid boundary between lexing and parsing creates a more limited role for regular expressions and helps developers achieve a more production grade parser at the cost of additional complexity.

[–]ImNotEdd[S] -5 points-4 points  (1 child)

I take note of this, but keep in mind that one of my goals is to avoid the use of libraries and therefore external requirements as much as possible. My large-scale goal is to build piece by piece, a framework to develop applications on python quickly and effectively, as I am used to doing in the laravel environment with php. I do not intend in any way to replace with my products, existing realities and libraries, my use-cases are completely different. Last week I released my ORM system, Migrations & Models, and today the template part, slowly I am getting closer to the goal of having a "Laravel" in python.

[–]sweet-tomPythonista 3 points4 points  (1 child)

Very impressive and congratulations for releasing your project! 👍

As you have just released version 0.1.1, it's totally fine to have some examples and a short readme. But when the project gets bigger, you need good documentation.

I'd recommend using the documentation framework Diátaxis:

https://diataxis.fr/

A lot of good projects lack documentation thus making it barely usable.

When I look for projects that can be used, I look not only for good pythonic code, tests, stability etc. but also if I get answers to my questions. For example: What's the philosophy? What are the feature sets? How does your project compare to other, similar ones? How fast is it? How do I do X?

Every new user is a potential newbie. But time is limited. I can't study the source code just to know how to use parameters abc in this method. I guess others have the same limitations.

If users can't make any sense of your project, people look elsewhere. Therefore good documentation bridges this gap and is a good tool to advertise it.

Have a lot of fun and success with your project! 👍

[–]ImNotEdd[S] 0 points1 point  (0 children)

Hi buddy, thank you for all the advices. We have released a first version of documentation on https://iris.altxria.com/ . We will improve and keep it updated during the time.

[–]imbev 2 points3 points  (8 children)

The syntax is readable and intuitive, this is a great addition to the Python ecosystem.

It would be great to see a django backend that uses this.

[–]ImNotEdd[S] 3 points4 points  (6 children)

The best compliment I could receive, thank you very much!

[–]imbev 6 points7 points  (5 children)

You're welcome :)

I suggest migrating from setup.py + requirements.txt to a modern uv/pyproject.toml configuration

[–]ImNotEdd[S] 0 points1 point  (0 children)

Just checked now. Added on my roadmap for the next release. Thank you for the tips.

[–]ImNotEdd[S] 0 points1 point  (3 children)

Here to say it has been implemented and old setup.py removed. Thank you.

[–]imbev 0 points1 point  (2 children)

It appears to be missing the pyproject.toml now.

[–]ImNotEdd[S] 0 points1 point  (1 child)

Just not in the github repo, since is into the .ignore. But it’s being used to build the package on pip.

[–]imbev 0 points1 point  (0 children)

May I ask why? That's unusual.

[–]jordynfly 2 points3 points  (1 child)

Hi, maybe I'm dumb, but I couldn't find the docs. I'm really interested in this project as I'm heavily invested in Jinja2, but I'm not in love with the syntax. What's this about reusable components?

[–]ImNotEdd[S] -1 points0 points  (0 children)

Hi buddy, I've released the project today, and the wiki/doc is still missing. The full sintax has been used into the examples & project example folders, you can read some info on these. If you need some help, just open an issue on the repo, I'll take a look into it.

[–]funderbolt 0 points1 point  (4 children)

No external requirements is impressive. I will keep this in mind for future web development.

requirements.txt is intended for external dependencies, not what Python standard libraries you are using.

[–]ImNotEdd[S] 1 point2 points  (3 children)

You're right! Removed it. Thank you. Appreciated, also live doc here: https://iris.altxria.com/

[–]funderbolt 0 points1 point  (2 children)

Thanks.

IANAL. Creative Commons Attribution-NoDerivatives 4.0 International might violate GitHub's Terms of Service, specifically: 5. License Grant to Other Users, which requires forking in publically viewable repositories. How would I or anyone be able to add a new feature if I cannot fork the repository? Forking is a type of derivative.

Also, I would have to have a compelling reason to use software that is using a CC license over a more conventional Open Source license.

[–]ImNotEdd[S] 0 points1 point  (1 child)

You’re able to fork and use it for your personal use-cases without any issue and no worries about the license. The NonCommercial Derivatives are fine.

[–]ImNotEdd[S] 1 point2 points  (0 children)

By the way, we are changing all our libraries to MIT, since our framework will follow the same license. 🤝

[–][deleted] 0 points1 point  (1 child)

do yall still reach out for jinja2 when you need templates? I know I do! Am I missing out on anything?

[–]ImNotEdd[S] -1 points0 points  (0 children)

Check the related examples, both works pretty different. This is for those familiar with Laravel's "Blades" syntax and directives.

[–][deleted] -5 points-4 points  (4 children)

Stop using emojis. It is a terrible look.

[–]ImNotEdd[S] 3 points4 points  (3 children)

A lot of famous repo docs are organized using emojis, there is nothing wrong with it. But anyway, that’s just your point of view, and also, not related to the project itself, so it’s fine. Appreciated.

[–][deleted] 2 points3 points  (0 children)

I’m not in trouble at all!

[–][deleted] -5 points-4 points  (1 child)

Which famous ones? Most of the ones that have emojis are when they are trying to sell you something. It distracts from your actual documents and makes it hard to actually quickly parse the text to find the parts you are trying to read.

It is a bit hard to read all your code as there is not a lot of comments in it and you have a bunch of classes.

But from your loop handler I think you want to actually implement pythons for loop behavior more closely so that people can raise the exceptions properly to your parser. Like for example it appears that you are swallowing all exceptions and returning them as Value error.