i think this is a fascinating project, though very...
# python-contributors
j
i think this is a fascinating project, though very much under represented in terms of the gravity. While i was writing some C porting syntax analogs for which I am informed
"<*>" will be illegal in 1.7
I came up with the notion that intellij is dominantly written in kotlin and kotlin has a PSI editor with syntax embedding which is therefore going to have significant export compatibility with kotlin as well, whether currently done or otherwise. in my code I would if i could simply wrap C code into an embedding and accept a guided tour of compiler errors to flesh out the declaration gaps needed. Instead I have been using sed and operator overloads to examine the gap and fill in the machinations that apparently already exist in a kotlin-native exports version of CPP. This also got me to thinking that this python project was making some mention of the steep difficulties in porting while there sits volumes of presumably kotlin-friendly pycharm code. The dichotomy appears unfortunate to me, that we pay and priotize editors which can perform language specific mappings while my experience proposing flexible language constructs in every language development conversation I have undertaken is almost always met with a summary that is not far from "we are very happy with how we solve programming problems and we feel that stability and usability excludes such matters". but if that's the case then why is there in fact so much effort undertaken from scratch to build front-end harnasses for the language that our editor front-ends are already doing a spectacular job of?
p
Hi! Sorry, I don't get your point. Looking at your screenshot, it looks like trying to rewrite some C/C++ code as literally as possible to Kotlin. Is this your goal?
j
that's what i was doing at the time that got me onto my tangent. kotlin has to my experience the most ammenable syntax to wrapping other programming language idioms but when you look into it further you find it's almost as if this was an unintended bug they are apparently working to resolve.
p
I actually agree with "them" 🙂 what's an idiom in language A isn't necessarily an idiom in language B. Each language has its nature/idea/"grain", and if you try to do something against the grain, it's no surprise to me things go awry
j
jetbrains also does this language embedding thing with their editors to drop a fully comprehending PSI model on top of a section of text, which is another source of cognitive dissonance wit the increasingly conservative programming environment
p
do you mean e.g. embedding Regex into Java? it makes perfect sense to me, as opposed to e.g. C++ and Java. Regex is not a general-purpose language and it solves a certain subproblem of programming
j
what's code in language A is also code in language B if there is the removal of the necessary impedences.
why no, I am not referring regex, I am referring to fo instance when you write a javascript code generator or in fact an html code generator inside kotlin as an example within """ and you designate part of the source code as html and you gain the benefit of editting html and when scoped, js in the kotlin source code.
there's no relation to kotlin per se but that's the most obvious example
p
yeah, that's helpful
anyway, I don't see how this topic is related to our little Python side-project 🙂 feel free to reach to JetBrains directly
j
have you looked into the PSI models as a means of leveraging the front-end you;re working on ? i'm late to the party, sorry if im not fully updated on the road to get to the present state
p
we don't work on the compiler frontend, just the backend for now (sorry if I'm missing something)
j
i think i might've mistaken this as some kind of way to reduce impedences between writing kotlin and executing python. I'll watch more closely and keep up.
p
the goal of the project is ironically stated at the end
j
this is pre-fir generating the example ?
p
FIR - frontend IR, still in development, right? what we do now is getting the same backend IR that Kotlin/JS gets, and instead emit Python