2022년 7월 3일 일요일
2022년 6월 29일 수요일
GitHub Copilot, 쓸수록 이거 물건이네.
코드 제안을 해주는 것도 좋은데, 가끔 귀찮아서 만들지 않았던 함수들을 제안한다.
아래 클래스, 변수, 함수 이름들은 임의의 값. 리턴값과 함수 이름이 적절한(?) 의미가 있다. 예를 들어 ABC라는 클래스의 유틸리티 함수 run이 있고 이 함수의 리턴 값이 hour라면, 아래와 같은 상태에서:
ABC abc
hours = abc.run(...)
seconds = abc. 라고 입력하면 적절한 함수 이름을 제시. 예를 들면 abc.fly(...)라고 제안.
fly(...)는 ABC 클래스에 없는 함수인데, seconds를 리턴하는데 적절한(?) 함수 이다.
잠시 고민.
전에는 run()을 호출해서 가져온 값을 가공해서 seconds를 만들었는데.. 그래.. 일하라고?
fly() 함수를 추가. fly() 함수를 추가할 때도 기존 run() 함수의 형식과 유사하게 필요한 부분만 변경해서 제안해준다. 그리고, 기존 관련 코드 부분도 refactoring해서 fly()를 사용하도록 수정.
결정만 내리면 되는?? 이거 어디까지 갈지 궁금하다. 알파고도 처음에는 사람 기보를 연구하다가, 알파제로는 게임의 로직만 가지고 알파고를 넘어섰던데..
2022년 5월 6일 금요일
intercept-build로 compile_commands.json 만들기
요즘 주로 사용하는 개발용 편집기는 vscode. 개발 프로젝트 중 C++의 경우 얼마전까지 vscode-ccls를 사용해서 go to definition 등을 처리했는데, 제대로 찾지 못하는 경우도 많고, problem report도 계속 표시되어 다른 툴을 알아보기 시작했다.
vscode-clangd를 사용해보기로 결정. vscode-clangd가 제대로 동작하려면 compilation database가 필요하다. Compilation database를 만들기 위해 Bear를 사용해서 makefile을 처리하도록 했는데, empty compilation databse만 생성된다.
Bear 개발자가 만든 다른 툴인 scan-build로 시도. scan-build는 llvm에 포함되어 있는 툴인데, Python으로 다시 만들고, intercept-build 등의 툴을 추가한 것으로 보인다. intercept-build로도 compilation database가 제대로 만들어지지 않아서 찾아보니 아래와 같이 CC CXX를 대체하도록 해서 성공.
intercept-build make CC=intercept-cc CXX=intercept-c++
2022년 4월 23일 토요일
Install Roswell on M1 Mac
Roswell is a Lisp implementation installer/manager, launcher, and much
more! It started as a command-line tool with the aim to make installing
and managing Common Lisp implementations really simple and easy. (https://roswell.github.io/)
There is a problem when installing Roswell using homebrew.
$ brew install roswell
$ ros setup
It fails to load sb-posix.
I couldn't found a solution and started to look into sbcl installation document and scripts.
I managed to fix the problem with following steps.
1. Go into sbcl source folder.
$ cd ~/.roswell/src/sbcl-2.2.2-arm64-darwin/
2. Run install.sh. it will copy fasl files to binary folder
$ INSTALL_ROOT=~/.roswell/impls/arm64/darwin/sbcl-bin/2.2.2 bash install.sh
2022년 4월 4일 월요일
2022년 3월 20일 일요일
듄 1, 프랭크 허버트
듄 전집을 샀다. 1권은 책이 너무 두꺼워서 읽을 때 불편하다. 등산할 때 오디오북을 많이 사용하는데, 전자책으로 살껄 그랬나. 그래도 책으로 사두면 나중에 애들이 읽을 것 같기도 하고.




