https://kotlinlang.org logo
#feed
Title
# feed
c

cedric

06/05/2019, 8:40 PM
👍🏻 2
😯 1
💥 11
💵 6
😱 4
c

Casey Brooks

06/05/2019, 8:44 PM
I was just thinking about this idea the other day, I’ll have to give it a shot soon!
c

cedric

06/05/2019, 8:45 PM
Feedback welcome!
i

irus

06/05/2019, 9:12 PM
So cache, essentially is kotlin repl + a number of built-in functions/properties that mimic coreutils and bash?
c

cedric

06/05/2019, 9:39 PM
@Ibragimov Yes, that’s the idea, although technically, it’s not a REPL that understands bash commands, it’s a core that reads lines and interprets them either as commands or Kotlin
👍 1
After having tried so many ways on bash and zsh to implement a smart prompt which all failed in bizarre ways, it was a relief to implement my prompt in Kotlin. And that one works all the time 🙂
s

suresh

06/06/2019, 1:45 AM
Copy code
~/code/kash(master) » ./run                                                                                                                                                            
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
You forgot to checkin the gradle jar file.
c

cedric

06/06/2019, 1:46 AM
oops
Let me fix that
It was .gitignored, duh. Pull again, @suresh
s

suresh

06/06/2019, 1:49 AM
👍
generating a native-image (graalvm) would nice
c

cedric

06/06/2019, 1:52 AM
Good idea, I haven't quite thought about the packaging.
c

cedric

06/06/2019, 1:54 AM
all classes need to be known at native image generation time so that the static analysis can process them.
This might be an issue if I want users of Kash to be able to add their own classpath before the shell launches
I was leaning toward a wrapper approach for now, like Kobalt/Gradle.
s

suresh

06/06/2019, 1:54 AM
yeah that’s the limitation for AOT compilation.
jdk11 still has this warning message
Copy code
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.openapi.util.JDOMUtil$2 (file:/Users/sgopal1/code/kash/build/libs/kosh-fat.jar) to constructor com.sun.xml.internal.stream.XMLInputFactoryImpl()
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.openapi.util.JDOMUtil$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
c

cedric

06/06/2019, 1:58 AM
I'm running jdk-11.0.3 and not seeing that message
How do you make it happen?
s

suresh

06/06/2019, 1:59 AM
oops sorry jdk12
Copy code
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment (build 12+33)
OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
c

cedric

06/06/2019, 1:59 AM
Bleeding edge uh
Is it working otherwise?
s

suresh

06/06/2019, 1:59 AM
yes 👍
r

ribesg

06/06/2019, 8:26 AM
Wow
j

Joram Visser

06/06/2019, 10:37 AM
Is there a reason you named the fat jar
kosh-fat
(instead of for example
kash-fat
)? Or just a consistent typo (in
build.gradle.kts
,
kash
,
kash-debug
and
run
)?
c

cedric

06/06/2019, 10:52 AM
I initially called the project
kosh
until I realized that
kash
would be a much better name, with the dollar sign and all. I forgot to rename in a few places...
j

Joram Visser

06/06/2019, 11:08 AM
👍
b

bdawg.io

06/07/2019, 5:59 AM
Is there shell compatibility for redirecting stderr? In bash you could do
2> /dev/null
to suppress errors
c

cedric

06/07/2019, 5:59 AM
It's trivial to add
@bdawg.io I just added support for
2>
, let me know how it works for you
🎉 3
5 Views