# Kakoune needs a real scripting language

**URL:** <https://discuss.kakoune.com/t/kakoune-needs-a-real-scripting-language/575>\
**Category:** Complaints & Improvements\
**Created:** [May 16, 2019, 6:35pm UTC](https://discuss.kakoune.com/t/kakoune-needs-a-real-scripting-language/575 "2019-05-16T18:35:17Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![andreyorst](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/andreyorst/32/29_2.png) [@andreyorst](https://discuss.kakoune.com/u/andreyorst)\
**Post date:** [May 23, 2019, 3:57am UTC](https://discuss.kakoune.com/t/kakoune-needs-a-real-scripting-language/575/23 "2019-05-23T03:57:39Z")

</div>

I didn’t knew about `$kak_source` but it seems it is a thing that doesn’t available when we running commands defined in the script unless we store it some option:

filename vaiv.kak:

```auto
echo -debug %sh{ echo $kak_source } # prints path to vaiv.kak in debug buffer

declare-option str vaiv_path %val{source} # stores that path

define-command vaiv %{
    echo -debug %sh{ echo $kak_source } # prints nothing
    echo -debug %sh{ echo $kak_opt_vaiv_path } # prints correct path again
}

```

Documentation says:

> path of the file currently getting executed (through the source command)

Are there any caveats? Like, can I use this method in my plugins to separate them into files on different languages? Or there is a way in which this variable can be left empty? I guess it’s a question that should be addressed in [this Manual++](https://discuss.kakoune.com/t/expansions/540) topic (which seems to be lacking some value expansions, @robertmeta!)

* * *

~~@mawww~~

~~Hm. I was experimenting with my [langmap.kak](https://github.com/andreyorst/langmap.kak) plugin, and the `source` path part works fine - I can execute my Perl script no matter where plugin is placed. But the Perl script itself doesn’t work anymore.~~

~~I’ve pushed it to [test branch](https://github.com/andreyorst/langmap.kak/tree/external-perl-test). Not sure why it isn’t working.~~

~~Previously I used `STDOUT` from Perl to set options and execute map commands, but now, when perl isn’t inline Perl (`perl -e ' ... '`) I thought that I should pass `$kak_client` into it, wrap all inside commands into `eval -client $passed_client`, and pipe its output to `| kak -p $kak_session`, but that’s not working for some reason. I’m not asking you to dig in my code, but maybe I just missed something obvious.~~

Edit: nwm, it was my mistake.

---

_[View the full topic](https://discuss.kakoune.com/t/kakoune-needs-a-real-scripting-language/575)._
