Git Product home page Git Product logo

basic-kotlin-code's Introduction

Kotlin 컴파일러를 활용한 Code Snipet 실행

.kt 파일을 컴파일 할 때

Hello.kt파일(클래스 미포함)의 경우

kotlinc-jvm Hello.kt -d Hello.jar
kotlin -classpath Hello.jar HelloKt

Hello.kt 파일이 함수만을 가지고 있고 클래스가 아니라면 코틀린 컴파일러가 자동으로 확장자를 제거한 파일 이름을 가지고 Kt라는 접미사를 추가한 클래스 이름을 만든다.

코틀린 스크립트(.kts)파일을 즉시 실행할 때(REPL 실험)

myscript.kts의 경우

kotlinc-jvm -script myscript.kts

Unix-like 시스템을 쓸 경우 셔뱅(shebang)을 사용할 수 있다.

#!/usr/bin/env kotlinc-jvm -script
println("hi")

basic-kotlin-code's People

Contributors

cubeskkim avatar novaray avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.