셰프(프로그래밍 언어)

덤프버전 :


1. 개요
2. 예제


1. 개요[편집]


데이비드 모건 마(David Morgan-Mar)가 제작한 난해한 프로그래밍 언어.

참고로 데이비드 모건 마는 Ook!, BIT, Haifu, HQ9++(HQ9+의 업그레이드 버전), ZOMBIE 등 수많은 난해한 프로그래밍 언어들을 제작한 변태다. 겁스 제작에 참여한 경력도 있고... 하여튼 비범한 인간이라고 보면 된다.

셰프(Chef) 언어라는 말 그대로 프로그램의 구조가 레시피처럼 되어있는 게 특징이다. 스택 구조를 사용하며, 명령어를 사용하여 스택에 차례차례 변수를 넣는 방식으로 구성되며 여기서는 스택을 사발(Mixing Bowl)이라고 부른다. 구성은 다음과 같다.
  • 타이틀
  • 명령어: 전부 음식 이름이다.
  • 스택에 대입하는 방법을 프로그래밍
또한 나름의 디자인 철학도 있다.
  • 프로그램 요리법은 유효한 출력값을 지녀야할 뿐만 아니라 따라하기 쉽고 맛있어야 한다.
  • 요리법은 미터법을 사용해야 하나 컵, 스푼, 꼬집 같은 전통적인 계량법도 사용할 수 있다.


2. 예제[편집]


이것으로 Hello, world!를 짜면 다음과 같다. 조리 품목은 수플레이다. 아래의 레시피대로 음식을 만들면 큰일난다
Hello World Souffle.
 
 Ingredients.
 72 g haricot beans
 101 eggs
 108 g lard
 111 cups oil
 32 zucchinis
 119 ml water
 114 g red salmon
 100 g dijon mustard
 33 potatoes
 
 Method.
 Put potatoes into the mixing bowl.
 Put dijon mustard into the mixing bowl.
 Put lard into the mixing bowl.
 Put red salmon into the mixing bowl.
 Put oil into the mixing bowl.
 Put water into the mixing bowl.
 Put zucchinis into the mixing bowl.
 Put oil into the mixing bowl.
 Put lard into the mixing bowl.
 Put lard into the mixing bowl.
 Put eggs into the mixing bowl.
 Put haricot beans into the mixing bowl.
 Liquefy contents of the mixing bowl.
 Pour contents of the mixing bowl into the baking dish.
 
 Serves 1.

위의 Hello, world!는 언어 개발자 본인이 짠 것임에도 불구하고 디자인 철학 중 하나인 '따라하기 쉽고 맛있을 것'에 위배되는 문제가 있다(...).[1] 그래서 Mike Worth라는 사람이 다시 짠 것이 있다. 위의 맛이 간 듯 한 요리법과는 다르게 그럴듯해 보이는 초콜릿 케이크 레시피다. 또한 코드를 짠 본인이 실제 소스코드대로 조리함으로써 제대로 된 조리법임을 입증했다! 조리 가능할 뿐만 아니라 맛도 상당히 괜찮았다고 한다.
Hello World Cake with Chocolate sauce.
 
 This prints hello world, while being tastier than Hello World Souffle. The main
 chef makes a " world!" cake, which he puts in the baking dish. When he gets the
 sous chef to make the "Hello" chocolate sauce, it gets put into the baking dish
 and then the whole thing is printed when he refrigerates the sauce. When
 actually cooking, I'm interpreting the chocolate sauce baking dish to be
 separate from the cake one and Liquify to mean either melt or blend depending on
 context.
 
 Ingredients.
 33 g chocolate chips
 100 g butter
 54 ml double cream
 2 pinches baking powder
 114 g sugar
 111 ml beaten eggs
 119 g flour
 32 g cocoa powder
 0 g cake mixture
 
 Cooking time: 25 minutes.
 
 Pre-heat oven to 180 degrees Celsius.
 
 Method.
 Put chocolate chips into the mixing bowl.
 Put butter into the mixing bowl.
 Put sugar into the mixing bowl.
 Put beaten eggs into the mixing bowl.
 Put flour into the mixing bowl.
 Put baking powder into the mixing bowl.
 Put cocoa  powder into the mixing bowl.
 Stir the mixing bowl for 1 minute.
 Combine double cream into the mixing bowl.
 Stir the mixing bowl for 4 minutes.
 Liquify the contents of the mixing bowl.
 Pour contents of the mixing bowl into the baking dish.
 bake the cake mixture.
 Wait until baked.
 Serve with chocolate sauce.
 
 chocolate sauce.
 
 Ingredients.
 111 g sugar
 108 ml hot water
 108 ml heated double cream
 101 g dark chocolate
 72 g milk chocolate
 
 Method.
 Clean the mixing bowl.
 Put sugar into the mixing bowl.
 Put hot water into the mixing bowl.
 Put heated double cream into the mixing bowl.
 dissolve the sugar.
 agitate the sugar until dissolved.
 Liquify the dark chocolate.
 Put dark chocolate into the mixing bowl.
 Liquify the milk chocolate.
 Put milk chocolate into the mixing bowl.
 Liquify contents of the mixing bowl.
 Pour contents of the mixing bowl into the baking dish.
 Refrigerate for 1 hour.

파일:크리에이티브 커먼즈 라이선스__CC.png 이 문서의 내용 중 전체 또는 일부는 2023-12-03 19:21:57에 나무위키 셰프(프로그래밍 언어) 문서에서 가져왔습니다.

[1] 재료만 봐도 달걀 111개, 라드 108g에 식용유 111컵이 들어갔는데 1인분이라 적혀있으니 정상적으로는 맛있게 먹을 수가 없다. 자세히 보면 애호박과 감자를 제외한 각 식재료의 용량이 첫 글자의 아스키 코드로 되어 있다. '애호박 32개'는 빈칸( ), '감자 33개'는 느낌표(!).