Global variables prohibited?

10 views
Skip to first unread message

Matthias

unread,
Feb 1, 2020, 5:56:40 AM2/1/20
to blech-lang
Hi Blech Team,

today, I made the observation that I get an compiler error whenever I try to declare a global variable (outside activity and function) in Blech. I assume that this is a deliberate design decision of Blech in order to overcome all the drawbacks and pitfalls of global variable memory. I just wanted to get a confirmation from your side on that point (just to ensure that it is not a compiler bug).

By the way: The error just says "unexpected token". Maybe, for future evolution of Blech, the message could be more descriptive, e.g. " 'var' not allowed in global scope", or something like that.

Regards,
Matthias

Gretz Friedrich (CR/AEE1)

unread,
Feb 1, 2020, 9:31:25 AM2/1/20
to blech-lang

Hi Matthias,

your observation and conclusion are correct. We have just recently started working on a documentation. You can already find the relevant statement in

https://github.com/boschresearch/blech-doc/blob/master/documentation/blech-user-manual/declarations.adoc

Feel free to create pull requests or issues whenever you find a way to improve the documentation text.

 

I agree that the parser error messages are close to useless in their current form. That is because we solely rely on the auto-generated error messages from yacc whenever no grammar rule matches. Improving this is future work.

 

Best,
Friedrich

--
You received this message because you are subscribed to the Google Groups "blech-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blech-lang+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/blech-lang/7feb28b2-da34-43c1-a85f-c38b20edf2ae%40googlegroups.com.

Matthias

unread,
Feb 3, 2020, 6:29:30 AM2/3/20
to blech-lang
Hi Friedrich,

thanks for the feedback!

Regards,
Matthias

Reply all
Reply to author
Forward
0 new messages