Recent

Author Topic: Cython for Pascal  (Read 1107 times)

Webdrifter

  • Jr. Member
  • **
  • Posts: 68
Cython for Pascal
« on: December 20, 2022, 02:15:15 pm »
Hope this is the right place for my question/suggestion.

As we all know Python and C have an enormous popularity advantage over Pascal.
And that quality is not the major problem for the future of Pascal and Lazarus, but their lack of popularity is.

We also know that speed is one of Pythons major problems, in particular because Python is widely used for AI and serious AI applications require a lot of calculation speed.

Cython is a great way to speed up Python using C.

My question/suggestion: Does there already exist something similar like Cython but using Pascal instead?

If so, maybe it could be a great way to entice programmers to use Pascal and thus increase the popularity of Pascal and ultimately Lazarus.

(Which may ultimately also contribute to the development of Pascal and Lazarus, and thus ensure the realization of a virtuous circle of popularity and development.)

Or is this a dumb idea? (Forgive me I'm a hobbyist without IT-background).

AlexTP

  • Hero Member
  • *****
  • Posts: 2406
    • UVviewsoft
Re: Cython for Pascal
« Reply #1 on: December 20, 2022, 02:17:40 pm »
Such thing does not exist.

Bogen85

  • Hero Member
  • *****
  • Posts: 595
Re: Cython for Pascal
« Reply #2 on: December 20, 2022, 02:29:42 pm »
Cython is a great way to speed up Python using C.

For some things. Many of the core modules for Python are already written in C (or Rust), especially ones that are speed critical.

From what I've seen Cython makes it easier to write Python modules that need to link to a lot of existing C code.

My question/suggestion: Does there already exist something similar like Cython but using Pascal instead?

If so, maybe it could be a great way to entice programmers to use Pascal and thus increase the popularity of Pascal and ultimately Lazarus.

(Which may ultimately also contribute to the development of Pascal and Lazarus, and thus ensure the realization of a virtuous circle of popularity and development.)

No, does not exist, and would take many years to develop, with potentially little gain.

Cython already exists, and Cython modules can be used in any environment where python modules can be used.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Cython for Pascal
« Reply #3 on: December 20, 2022, 02:34:58 pm »
Such thing does not exist.

I agree. I have in the past investigated embedding Python (only v2, since that's what I needed) in an FPC program, and in principle it would not have been too difficult to extend that so that a Python script could call Pascal to implement a UI. I might revisit it at some point if it turns out that I still have the requirement, but that really is as far as I'm going.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Cython for Pascal
« Reply #4 on: December 20, 2022, 03:17:17 pm »
- IF Python has any speed it is because most of its libraries are compiled to a native language, not Python.
- There are Python bindings for FreePascal.
- You can write Python extensions in FreePascal.

I would not worry too much otherwise.

(I use Python and the above daily )
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018