BIBLIOGRAPHY
“Exercism.” 2024. In Wikipedia. https://en.wikipedia.org/w/index.php?title=Exercism&oldid=1222771040.
Related-Notes
유효한가?!
- #이맥스 통합개발환경: #AWK 검토해보다가 들려요.
모든 언어를 배울 때, 특히 Emacs 에서는 이게 정말 좋다.
개발 환경 측면에서 검증을 먼저 해야 하지 않는가? 그걸 한번에 해결해준다. 여기에 하나씩 Hello World 만 검증해봐도 개발 툴로서 막히는 부분이 사라질 것이다.
awk bash clojure elixir emacs-lisp javascript python r racket Hello World 예제만으로도 핵심 문제를 검증한다.
엑서시즘 CLI 업데이트
exercism upgrade
Exercism
(“Exercism” 2024)
- Exercism is an online, open-source, free coding platform that offers code practice and mentorship on 68 different programming languages.
- coding platform that offers code practice and mentorship
NOTE treesitter and eglot
elixir 에서 한 것 처럼 간단하게 개발 환경을 구성하고 검증할 수 있다. 그렇게 되면 여러모로 편하다.
javascript
track [1/2]
- Hello-World
- [ ]
How to use
굉장히 훌륭한 시스템이다. 아무렴 어떤가 이렇게 동작하는구나. 이렇게 하고 https://exercism.org/tracks/javascript
가서 언락을 하면 과정을 제대로 시작할 수 있다. 주요 언어에 대해서는 구성이 잘 되있다. 언어를 배우고 그 다음에 연습 과제를 할 수 있다. 아무렴 이렇게 하는 방법이 최선이다. 무엇보다 Emacs 와 연동이 되니까. 에디터 다루기에도 도움이 된다.
caption=“<span class=“figure-number”>Figure 1: hello-world” width=“100%” >
디렉토리에 연습 파일이 다운된다. 좋아. 대박.
clojure
[1/2]
- Hello-World
- [ ]
How to Use
아래 스크린샷 하나로 모든 것을 보인다. 기본 예제인데 여기서 Cider REPL 연결하고 LSP 연동하여 테스트까지 다채로운 경험을 할 수 있다. 여기서 네오트리는 본 예제에만 집중하도록 트리를 보여준다. 이 또한 좋은 일이다.
테스트를 할 수 있도록 테스트 러너가 들어있다. 테스트 러너 연동하는 방법 알려줘!!
{:aliases {:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "705ad25bbf0228b1c38d0244a36001c2987d7337"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}}}
caption=“<span class=“figure-number”>Figure 2: clojure” width=“100%” >
configure CIDER test runner
테스트 코드가 들어가 있다. 이것은 위에 언급한 바 테스트 러너를 활용해야 한다.
(ns hello-world-test
(:require [clojure.test :refer [deftest is]]
hello-world))
(deftest hello-world-test
(is (= "Hello, World!" (hello-world/hello))))
이 코드를 어떻게 테스트 할 수 있지? 물론 커맨드라인에서 하면 되는데? 그거 말고 이맥스에서 바로 해보자구. 사이더 또는 쿠차로 하면 되잖아. 넣어놨으니까.
https://practical.li/spacemacs/testing/unit-testing/configure-cider-test-runner/
위의 문서를 보면 Cider 에서 테스트 러너 관련 이슈는
- Test reports on success
- 성공 시에도 표기하도록
- Automatically running tests
- , T t (cider-auto-test-mode) toggles automatic test.
- , e b evaluates the current buffer and automatically runs the CIDER test runner using all tests for that namespace
- Custom test namespaces
- cider-test-infer-test-ns 값을 변경하는 함수가 왜 필요한가? 기본은 -test 를
붙이는 것. 이를 바꾸는 예제가 있다.
- Macros to define tests
- deftest, defspec 으로 정의되지 않은 개별 테스트도 적용하기 위한 매크로
아무튼 테스트를 해보았다. 동작한다. cider-test-all-test 인가 정의 된 명령을 실행 시켰다. 자연스럽다. 아주 쉽다.
Test Summary
hello-world-test 1 ms
hello-world-test 1 ms
Tested 1 namespaces in 1 ms
Ran 1 assertions, in 1 test functions
1 passed
cider-test-fail-fast: t
run exercism cmdline test
테스트를 수행하면 다음과 같이 나온다. 커맨드라인으로 수행하는 것이다. 아무튼 좋다.
Running tests via `clj -X:test`
Running tests in #{"test"}
Testing hello-world-test
Ran 1 tests containing 1 assertions.
0 failures, 0 errors.
(TEST RESULTS FOR clojure - hello-world)
journey Learning
hello-world 를 제출하고 web 에서 mark complete 를 하면 이제 Learn 을 할 수 있다. 훌륭하다. 다음과 같은 코스웍이다.
할 수 있는 예제는 정해져 있다. 여기에 따른 교육 프로그램도 가이드를 해주니 배우기 쉽다. 다른 자료가 필요가 없다.
caption=“<span class=“figure-number”>Figure 3: learn” width=“100%” >
emacs-lisp
track [1/2]
Learn 모드를 지원 안하니까 모든 예제가 다운로드 되는구나. 테스트 함수까지 하라는데로 했다. 아주 훌륭하다. 문서가 좋다. 멀리 벗어날 필요가 없는 구조다.
- Hello-World
- [ ]
awk
track [0/2]
- Hello-World
- [ ]
bash
track [0/2]
- Hello-World
- [ ]
python
track [1/2]
- Python exercises on Exercism - exercism.org
- Test Driven Development | Exercism’s Docs - exercism.org
pytest.ini 만들어 주면 된다. pytest 설치한다. 운영체제에 맞도록 이렇게 하면 바로 테스트 호출 할 수 있다.
[pytest]
markers =
task: A concept exercise task.
진행 상황
- Hello-World
- [ ]
이맥스 지원 현황
- 스페이스맥스 둠이맥스 등
R
track [0/2]
- Hello-World
- [ ]
racket
track
- Hello-World
- [ ]
elixir
track
https://exercism.org/tracks/elixir
- Hello-World
- [ ]
haskell
track
https://exercism.org/tracks/haskell
INSTALL and Setup
token : ebc61fc1-6560-4f84-92e6-21d55d303894
You have configured the Exercism command-line client:
Config dir: /home/junghan/.config/exercism
Token: (-t, --token) ebc61fc1-6560-4f84-92e6-21d55d303894
Workspace: (-w, --workspace) /home/junghan/exercism
API Base URL: (-a, --api) https://api.exercism.io/v1
jhnuc :: ~ »
봐봐 이렇게 추가 된다. 여기에 쭉 코드가 들어간다.
/home/junghan/exercism:
합계 16K
drwxr-xr-x 3 junghan 4.0K 2023-11-21 16:25 clojure/
drwxr-xr-x 3 junghan 4.0K 2023-11-21 16:25 common-lisp/
drwxr-xr-x 3 junghan 4.0K 2023-11-03 22:40 elixir/
drwxr-xr-x 3 junghan 4.0K 2023-11-21 15:52 javascript/