# Experiences coming from other languages to Racket?

**URL:** https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170
**Category:** General
**Created:** [November 21, 2021, 2:26pm UTC](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170 "2021-11-21T14:26:44Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![ryanc](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ryanc/32/71_2.png) [@ryanc](https://racket.discourse.group/u/ryanc)
#### Post date: [November 23, 2021, 9:37pm UTC](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170/21 "2021-11-23T21:37:27Z")

</div>

Whoops, I replied with the wrong button the first time around. See previous message.

---

<div class="post-metadata">

### Author: ![anentropic](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/anentropic/32/123_2.png) [@anentropic](https://racket.discourse.group/u/anentropic)
#### Post date: [November 23, 2021, 11:36pm UTC](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170/22 "2021-11-23T23:36:57Z")

</div>

> [@ryanc](#):
>
> . For example, the blue box for a macro is labeled "syntax" vs "procedure" for a procedure. It would be useful to know where we fell short for you.

It was about 18 months ago now, I forget a bit... looking back it seems I ran into it with `sql` and not `db` (I ended up switching to using `db` instead)

The example that bugged me at the time was `create-table` (docs [SQL: A Structured Notation for SQL Statements](https://docs.racket-lang.org/sql/index.html#%28form._%28%28lib._sql%2Fmain..rkt%29._create-table%29%29))

For some reason this isn't a function taking a string arg for the table name, but a macro that uses a ... syntax token (? 🤷‍♂️)

e.g. in this example

```racket
(create-table numbers
    #:columns [n integer #:not-null] [t text]
    #:constraints (primary-key n))

```

... `numbers` isn't a variable but the actual name of the table to create.

To be fair, the docs linked above highlight this as a "syntax" rather than a "procedure".

Then the other confusion I had was [racket - Dynamically generating rackunit test-suite: tests pass and also raise exception - Stack Overflow](https://stackoverflow.com/questions/63328739/dynamically-generating-rackunit-test-suite-tests-pass-and-also-raise-exception) ...again this was my fault for trying to treat a syntax as a function, and I eventually found a pleasant solution.

My feeling at the time was that syntax macros make things easier for library authors at expense of making creative usages more cumbersome for users. But I think that's not fair or true, and the "problem" was more of an impedance mismatch between my Python-trained brain and the Racket ways of doing things.

I think naively trying to avoid syntax macros was a mistake on my part, and I think maybe they should be among the _first_ things you learn to manipulate and create - at least for those coming to Racket from other langs and not totally new to programming.

Probably there are useful lessons to learn from the decisions made in these Racket libraries, to understand why `test-case` is a syntax macro and not just a function that returns a test case. Probably there are common techniques and design patterns involved, maybe solving familiar problems but in a non OOP way.

Anyway, all this is just first impressions of a newcomer.

---

<div class="post-metadata">

### Author: ![ryanc](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/ryanc/32/71_2.png) [@ryanc](https://racket.discourse.group/u/ryanc)
#### Post date: [November 24, 2021, 8:40pm UTC](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170/23 "2021-11-24T20:40:32Z")

</div>

Thanks, that makes sense.

---

<div class="post-metadata">

### Author: ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)
#### Post date: [July 16, 2024, 8:54pm UTC](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170/24 "2024-07-16T20:54:56Z")

</div>

Wow, thanks for mentioning `MrEd Designer`! Freaking blowing my mind right now.

[Previous page](https://racket.discourse.group/t/experiences-coming-from-other-languages-to-racket/170.md?page=1)
