GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Regex implementation is missing · Issue #3 · purescript-python/purescript-strings.py

Regex implementation is missing #3

New issue
Copy link
New issue
Copy link
Open
Open
Regex implementation is missing#3
Copy link

Description

@mikesol
mikesol
opened on Jul 9, 2020
Issue body actions

https://github.com/purescript-python/purescript-strings.py/blob/master/python-ffi/Data/String/Regex.py
@Hong-Xiang could you please add a note to the readme about why these functions are not yet implemented so contributors know the challenges to overcome? If it is simple to implement them, I can do it, but if there is a blocker then it'd be helpful to know. Thanks!

Activity

  1. Hong-Xiang commented on Jul 10, 2020

    @Hong-Xiang
    Hong-Xiang
    on Jul 10, 2020
    Collaborator
    More actions

    @mikesol , thanks for your attention!

    Data.String.Regex and related modules is not supported yet, due problems in implementing purescript-strings/src/Data/String/Regex.js.

    It seems Regex.js is a wrap on native JS RegExp and related methods, the largest problem is there are some small differences between syntax and semantics of regular expression of JS RegExp and Python's re module. There are some python libraries trying to do the translation, e.g. js-regex.

    Drop support for Purescript libraries that uses Regex, and simply wrap re may be a solution, but this may cause lots of problems in future.

    If we want to support PureScript libraries, we may either

    1. transform all JS RegExp to equivalent re version, but there maybe some cases there is no equivalent re version.
    2. or implement a port of JS RegExp in Python, then we may need consider performance issues

    Another smaller problem is that for users of Purescript-Python, we may assume they are more familiar with Python than JavaScript, then when using a Regex lib provided by strings, the first attempt maybe direct port Python re expression,
    the point is for some simple cases this may work, but they may got some subtle bugs.

    About adding these notes to README, since currently I don't have a clear conclusion on how to fix this, to avoid possible misleading, how about have a discussion here and add a link in README to this issue?

  2. mikesol commented on Jul 10, 2020

    @mikesol
    mikesol
    on Jul 10, 2020
    Author
    More actions

    Thanks @Hong-Xiang for the solid explanation!

    Between your two suggestions, I'd recommend the second. There are several packages on pursuit (ie the tapReporter for purescript-spec) that use Data.String.Regex, so by making a python-only port, we'd close off use of those libraries.

    I agree that a python-native regex library is a good idea, especially so that it is comfortable for python developers. I think that this should be a separate package, ie purescript-regex-python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.