프로그래밍 언어
-
VSCode에서 자바스크립트(Javascript) 실행하는 방법(VSCode와 Node.js로 시작하기)프로그래밍 언어/Javascript 2024. 8. 10. 21:16
들어가면서..Javascript는 웹 개발에서 꼭 필요한 언어 중 하나입니다. 우리가 매일 사용하는 웹사이트들이 자바스크립트를 통해 동작을 한다고 해도 과언이 아닙니다. 웹 페이지에서 단순히 글자와 이미지가 표시되는 것만으로는 부족할 때, 자바스크립트가 등장해 사이트를 더 생동감 있게 만들어주었습니다. 버튼을 클릭했을 때 새로운 내용이 나타나거나, 실시간으로 데이터를 업데이트하는 기능들, 웹에서 보는 애니메이션 같은 것도 모두 자바스크립트로 구현해낼 수 있습니다. 자바스크립트는 원래 웹 브라우저 안에서만 쓰였던 언어였지만 이제는 Node.js 덕분에 서버에서도 사용할 수 있습니다. 이 말은, 자바스크립트를 잘 배워두면 웹 사이트의 앞단과 뒷단, 즉 프로트엔드와 백엔드를 모두 다룰 수 있는 "풀스택" 개..
-
[Julia] Package와 Library 개념프로그래밍 언어/Julia 2024. 7. 16. 16:37
Julia 언어에서도 Python과 마찬가지로 기능을 확장하고 재사용할 수 있는 모듈이 있다. 이 모듈들은 Julia에서 "패키지(Package)"라고 불린다. Julia의 패키지는 Python의 라이브러리와 동일한 개념을 가진다고 생각하면 된다. Python에서는 "라이브러리(Library)"와 "패키지(Package)"라는 용어가 혼용되어 사용되고 있지만, 엄밀히 따지면 서로 다른 개념이다. 먼저, 라이브러리는 일반적으로 특정 기능을 수행하기 위해 작성된 코드의 집합을 의미한다. 이는 단일 모듈이 될 수도 있고, 여러 모듈로 구성될 수도 있다. Python에서 라이브러리는 일반적으로 다양한 함수와 클래스를 제공하여 개발자가 특정 작업을 보다 쉽게 수행할 수 있도록 돕는다. 예를 들어, 과학 계산을 위..
-
[Julia] Julia 언어 함수 정의 및 호출프로그래밍 언어/Julia 2024. 7. 15. 10:21
1. 함수 정의줄리아에서 함수는 'function' 키워드를 사용하여 정의할 수 있다. 아래와 같이 함수의 이름, 인자 목록, 본문, 그리고 'end' 키워드로 구성된다.function say_hello() println("Hello, World!")end 위의 예제는 'say_hello'라는 이름의 함수를 정의하며, 이 함수는 호출될 때 "Hello, World!"를 출력한다.2. 함수 호출정의된 함수는 함수명을 사용하여 호출할 수 있다.say_hello() 이 코드는 위에 say_hell 함수를 호출하여 "Hello, World!"를 출력한다.3. 인자와 반환값3.1 인자함수는 인자를 받아서 처리할 수 있으며, 인자는 함수 정의 시에 관호 안에 나열한다.function greet(name) ..
-
[Julia] Julia 언어 제어문과 반복문프로그래밍 언어/Julia 2024. 7. 14. 18:19
1. 제어문제어문은 조건에 따라 코드 블록을 실행하거나 건너뛸 수 있도록 한다. 줄리아에서는 'if', 'else', 'elseif'를 사용하여 조건문을 작성한다. 이를 통해 프로그램의 흐름을 제어할 수 있다.1. if문'if'문은 조건이 참일 때 코드 블록을 실행하며, 조건이 거짓이면 해당 블록을 건너뛴다.x = 10if x > 5 println("x is greater than 5.")end 위의 예제에서 'x'가 5보다 크기 때문에 "x is greater than 5."라는 메시지가 출력된다. 만약 'x'가 5보다 작거나 같다면 아무것도 출력되지 않는다.2. if-else문'if-else'문은 조건이 참일 때와 거짓일 때 실행할 코드 블록을 각각 정의한다.x = 3if x > 5 pri..
-
[Julia] Julia 언어 기초 문법 및 데이터 타입프로그래밍 언어/Julia 2024. 7. 13. 17:19
1. Julia 언어의 기본 문법1.1. 변수 선언Julia에서 변수 선언하는 방법은 변수명을 지정하고 값을 할당하면 된다. 변수명은 알파벳, 숫자, 밑줄('_')로 구성할 수 있으며, 숫자로 시작할 수는 없다. 아래의 간단한 예시로 살펴보면, 변수의 타입은 할당된 값에 따라 자동으로 결정된다. 'x'는 정수형, 'y'는 부동소수점형, 'name'은 문자열형 변수로 선언이 된다.x = 2 # 정수형y = 3.14 # 주동소수점형name = "Julia" # 문자열형1.2. 기본 연산자Julia는 다양한 기본 연산자를 제공하며, 산술 연산자, 비교 연산자, 비트 연산자 등이 있다. 각 연산자들은 다음과 같은 역할을 한다.산술연산자산술 연산자는 수치 데이터를 다루며, 덧..
-
[Julia] Julia 언어 문법: Python 언어와의 차이점을 알아보자프로그래밍 언어/Julia 2024. 7. 12. 12:23
0. 들어가기 전에Julia는 수치 계산과 고성능 처리를 위해 설계된 프로그래밍 언어로, MATLAB, Python, R과 같은 언어들과 많은 부분에서 비슷하면서도 독특한 문법적 특징을 가지고 있다. 이 중에서 특히 Python과 어떻게 다른지 알아보자.1. 함수 정의 및 호출Julia 함수 정의Julia에서는 'function' 을 사용하여 함수를 정의하는데, MATLAB에서 함수를 정의하는 모습과 유사하다.function add(a, b) a + bendresult = add(3, 5)println(result) # 출력: 8Python 함수 정의Python에서는 'def' 를 사용하여 함수를 정의한다.def add(a, b): return a + bresult = add(3, 5)pr..
-
[Julia] Visual Studio Code에서 Julia 개발 환경 구축하기프로그래밍 언어/Julia 2024. 7. 11. 01:20
0. 설치하기 전에VS Code에서 Julia 언어를 사용하기 위해서는 다음의 순서로 설치하면 된다.Julia 설치하기VS Code 설치하기VS Code Marketplace에서 Julia 확장 프로그램 설치자, 그러면 위의 순서대로 VS Code에서 Julia 개발 환경을 만들어보자.1. Julia 설치하기Julia는 Windows, macOS, Linux 모두 지원하고 있고, Julia 홈페이지에서 Julia를 설치한다.윈도우 검색창에 cmd라고 입력하고 명령 프롬프트를 열어준다. 그리고 아래와 같이 입력하고 엔터를 누르면 Julia 설치가 완료된다.>winget install julia -s msstore중간에 약관 동의를 하는지 2번 물어보는데 모두 y -> Enter를 하면 설치가 진행된다. 설..
-
[Julia] Julia 개발 환경 구축을 위한 IDE 종류 알아보기프로그래밍 언어/Julia 2024. 7. 10. 14:21
Julia 언어Julia는 MIT에서 개발한 동적 프로그래밍 언어이다. Julia는 병렬 컴퓨팅을 지원하기 때문에 MATALB 또는 Python 보다 코드의 실행 속도가 훨씬 빠르다. 아래 그림은 C언어와 비교했을 때, 각 프로그래밍 언어의 속도를 보여주고 있는데 Julia의 속도는 상당히 빠른 것을 알 수 있다.IDE란?IDE(Integrated Development Environment, 통합 개발 환경)는 소프트웨어 개발과 관련된 모든 작업을 하나의 프로그램 내에서 처리할 수 있는 환경을 제공하는 소프트웨어이다. 전통적으로 소프트웨어 개발에서는 컴파일러, 텍스트 편집기, 디버거 등을 개별적으로 사용했으나, 이러한 도구들을 하나로 통합하여 대화형 인터페이스를 제공하는 것이 IDE의 특징이다. 최근의 ..