10
hasu
6y

when you have to use one language inside of another, and you basically have to call functions allowing you to call the other's language function within it, and you get the hell confused, since it gets harder and harder to see what is what and who can call who and how, and the compiler ofc. won't say anything about it since it only cares about the main language you are in and not the nesting of the other...
I just have no idea what I'm doing right now, or if my thought process and understanding of this is even close to where it is supposed to be.
D: I'm just confused and insecure about this right now....

time for experiments to figure this out, and get the hang of it

Comments
  • 0
    Working on go/js projects, I often log things to the console, just to know which is what

    Can you log stuff in some sort of terminal/file at runtime? Not ideal but 'tis a solution :D
  • 1
    @Phlisg i tend to do that also a lot but in this case it might not help. I have a meeting with my supervisor later anyway so she might be able to tell me if this is correct or not, or if this is a bad approach generally.. xD we'll see
  • 0
    @hasu lucky to have a techy supervisor :)

    what language do you embed in another?
  • 0
    @Phlisg main language is lisp, and inside lisp we use prolog, and inside prolog sometimes we need a lisp function.

    I'm currently struggling with the syntax even. There is not that much documentation on it, and the lisp compiler ignores the prolog part kind of, so one is not quite sure if it's correct.
  • 1
    @hasu oh wow, it does sound complex hahaha I'm going back to my JS stuff :D
  • 1
    @Phlisg xD yeah. Research code. I'll play around with it more, I think I almost got done what I attempted. My supervisor says it's not necessary but I was close so now I want to know xD
  • 0
    @hasu you when you'll be over with it :D

    good luck! :)
  • 1
    @Phlisg depends. I might stay on it for a loooong time. Not sure I'll ever be done.
  • 2
    Good thing that you realize that languages within languages are a recipe for disaster.. once I've looked at some noob's hacking script that was.. wait for it.. Python within bash!! Such a convoluted mess that was probably glued together shit from Stack Overflow. I ended up reducing the size of her to a quarter of the original LOC, and only used bash. Refactoring the shit from others, why... 😞

    Anyway, be sure to get the hang of the language you're using before you write anything more permanent than a local dev branch 😅
  • 1
    Mixing languages is usually fine, like using Python and coding speed criticial or hardware related parts in C. Or coding in C and using assembly where C is too high level.

    But either these interworkings are very local so that it's easy to follow up, or you need well structured components with clear interfaces.
  • 0
    Lisp and prolog... Are you doing something related to computational linguistics or natural language processing?
  • 1
    @antorqs nop. Robot planning.
  • 1
    @antorqs but prolog is used to access the database for virtual reality data on which i base my plans.
Add Comment