![](/cs149/fall21content/media/dsl/images/slide_025.jpg)
![](/cs149/fall21content/media/users/minglotus/profile_unMHjmz.jpg)
![](/cs149/fall21content/media/users/shivalgo/profile_Dbwcbp9.jpg)
So, can we think of 'Func' as a typedef of Halide::Buffer
![](/cs149/fall21content/media/users/parthiv/profile.jpg)
The API for Halide is super slick! Would OpenCV also be considered a DSL? The Halide::Buffer
seems similar in concept to a cv::Mat
though the approach of defining functions rather than manipulating data directly is quite interesting and different to OpenCV's approach.
![](/cs149/fall21content/media/users/yt1118/profile.jpg)
This reminds me the difference between declarative and imperative programming languages: the Halide implementation here describes what should be done, while the C++ implementation in the previous slide states how it should be done (by using threads, SIMD, etc). DSLs tend to be declarative languages which hide internal implementation details from programmers.
![](/cs149/fall21content/media/users/lindenli/profile.jpg)
I like the separation between abstraction and implementation that @yt1118 is getting at. It's a common theme throughout the course, and allows programmers (or domain experts) interested in image-processing applications to utilize libraries that manage the difficulties of parallel implementation.
![](/cs149/fall21content/media/users/martigp/profile.jpg)
What is meant by the "infinite but discrete set of values". Not entirely sure how something can be infinite in computer science!
Please log in to leave a comment.
The similarity between domain-specific languages and powerful, efficient fundamental library is that, they extract the hard-core && common logic and make them re-usable -> application engineers don't need to re-invent.
However, libraries might be completely written in higher level languages (C++, Java, etc) or might be advanced to exploit platform-dependent libraries (e.g., SIMD intrinsics by Intel programmer manual, like in PA1). Whereas domain-specific languages usually cannot work without a proper compiler (e.g., CUDA program needs a specific compiler, and cannot run on AMD GPU w/o another intermediate representation). The compiler bridges application program and hardware, and usually has target-dependent code generators for different hardwares supported.