webdevRefinery Forum: BELL Converter - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline Nareshkumar_Rao 

  • Group: Members
  • Posts: 22
  • Joined: 17-July 11
  • Expertise:HTML,Javascript,Flash

Posted 07 May 2012 - 03:08 AM (#1)

BELL Converter


Converts easy to read/write BELL code to Java
BELLconverter
Current Version: v0.2

What is BELL?
BELL which stands for

Beginners
English
Legible
Language

is a very simple language for absolute beginners and people who are not good at computers to write very simple interactive applications.

I have created this language after seeing my computer illiterate father trying to build a simple console program with Visual C++. After helping him myself, I thought of a simpler language to begin teaching to computer "newbies" and such as we should give everyone, new, young or old a chance to make their own programs.

Okay, so what's BELLconverter?
BELLconverter is a converter that converts BELL code to Java code. This allows computer newbies to write in BELL code where they can pass it to a friend who knows Java and can add more elements into it and fine tune it.
It isn't necessary though, the person would just have to compile the outputted Java file

How to use it

Using the syntax of: java BELLconverter sample.bell sample
Then : javac sample.java

An compiled java class will be outputted: sample.class

Which can be run with: java sample

However, I have also included a quick_converter bat file, which will automatically run the converted and javac just by dragging the need BELL file onto the quick_converter bat file.

How does a BELL file look like?
As of v0.2, this sample incorporates all available functions (not alot... yet)
write This is a sample BELL file.
write Please Input Your Name:
let name be empty
ask-for name
write Nice, great to meet you %name%

This sample is from the sample.bell in the Git Repo.
It is readily convert-able into a Java file which can be immediately compiled into a class file.
0


User is offline Nand 

  • Group: Members
  • Posts: 36
  • Joined: 24-February 12
  • Expertise:PHP,SQL

Posted 07 May 2012 - 12:37 PM (#2)

Great idea, but I see a few problems with syntax:
1. "let name be empty"
This is harder to remember than most proper programming languages.
I'd suggest: "if name is empty"
2. Remove write all together...

If I may, an adjustment to syntax, here a sample of your program rewritten:

(This is a comment)
This is a sample BELL file.
Please Input Your Name:
if name is empty
name is user input
(or)
ask user for name

Thank you, name.
And may you have a good day.

Key words emboldened.

A very simple replacement into PHP will be:
/* this is a comment */
echo 'This is a sample BELL file.';
echo 'Please Input Your Name:';
if ($name == NULL) {
$name < cin; // yes PHP isn't like this
}

echo 'Thank you ' . $name . '';
echo 'And may you have a good day.';

0


User is offline callumacrae 

  • {{ post.author }}
  • Group: Members
  • Posts: 2862
  • Joined: 20-January 11
  • LocationWarwickshire, England
  • Expertise:HTML,CSS,PHP,Javascript,Node.js,SQL

Posted 07 May 2012 - 02:16 PM (#3)

Quote

1. "let name be empty"
This is harder to remember than most proper programming languages.
I'd suggest: "if name is empty"

That would be
name = null
; let is assignment (it's fairly standard).

I'm not a massive fan of the syntax, I would prefer something like this:

write This is a sample BELL file.
write Please input your name:
ask-for name
write Thank you, %name%
write And may you have a good day.


To output:

This is a sample BELL file.
Please input your name: Callum
Thanks you, Callum
And may you have a good day.

Front-end developer and writer
Twitter | GitHub | phpBB Contributor and Website Team Member | lynxphp
0


User is offline Nareshkumar_Rao 

  • Group: Members
  • Posts: 22
  • Joined: 17-July 11
  • Expertise:HTML,Javascript,Flash

Posted 08 May 2012 - 02:48 AM (#4)

View PostNand, on 07 May 2012 - 12:37 PM, said:

Great idea, but I see a few problems with syntax:
1. "let name be empty"
This is harder to remember than most proper programming languages.
I'd suggest: "if name is empty"
2. Remove write all together...


1. As callummacrae said, let is actually a standard when it comes to variables in Algebra.
2. It would be very messy without the write function, and text could get mixed up with commands. I tried keeping the commands as simple as possible.

I agree with your suggestion:
ask user for name


It would replace read-to very nicely. Similar to what callummacrae posted
ask-for name

Which is neater I guess.

Thank you for your suggestions, I will change the
ask-for var

and also probably remove
write-var var

and replace with
write %var%


Which was suggested by callummacrae.

Thanks guys :)

---- EDIT ----

I have pushed the latest commit with these changes.
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services