Skip to content

Commit

Permalink
New website
Browse files Browse the repository at this point in the history
  • Loading branch information
SolindekDev committed Nov 20, 2023
1 parent 3441823 commit 7baf279
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 71 deletions.
134 changes: 74 additions & 60 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,72 +7,86 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
<section>
<div class="sk1">
<div class="h1">Barn: Simple and Efficient Programming Language 🚀</div><br />
<span class="span">Barn is a simple and efficient programming language designed for beginners and experienced programmers alike. It is compiled to C, making it fast and portable. Barn has a clean and easy-to-read syntax, making it a great choice for learning programming. It also has a growing community of users and contributors.</span>
<br /><br />
<span class="span">So, the whole Barn adventure started when I got back from school, wondering about how compilers really work. I decided to dig into the topic a bit more. After picking up some knowledge, I thought, "Why not create my own programming language that will compile to C?". <br/><br/></span><span class="span">Now, why the name Barn? No clue, but it just stuck up because how short and easy it is (Barn means Children in Swedish... So saying "I like barn" in beautiful Stockholm might be a little risky).</span>
<br/>
<br/>
<span class="span"> The first compiler of barn, was named BarnGo, it was a bit of a mess and had lots of design issues. So, I decided to ditch the GoLang version and roll up my sleeves for a fresh start in C sometimes named BarnC.
<br/>
<br/></span>

<span class="span"> And here we are, on this wild ride of Barn development. It's been a journey, fixing things, making it better. Who knew diving into compiler intricacies could lead to this? Anyway, we're making a language, having some fun, and maybe learning a thing or two along the way!</span>
</span>
<div class="buttons">
<button class="btn" >Documentation</button>
<button class="btn" >Github</button>
<button class="btn" >Author</button>
<button class="btn" >Playground</button>
<button class="btn" >Discord</button>
</div>
<nav>
<div>
<img src="logo.png"/>
</div>
<div>
<ul>
<li><a href="/documentation.html">Documentation</a></li>
<li><a href="https://github.com/barn-lang/barn">Github</a></li>
<li><a href="/playground.html">Playground</a></li>
<li><a href="https://discord.gg/CaXfz6q4pk">Discord</a></li>
</ul>
</div>
<div class="sk2">
<code>
<!-- @import "std.ba"<br/><br/>
fun main() -> i32 {<br/>
&nbsp;&nbsp;&nbsp;&nbsp;fmt_print("Hello, World!")<br/>
}<br/> -->
</nav>
<div style="padding: 0% 4% 2% 4%;">
<section>
<div class="sk1">
<div class="h1">Barn: Simple and Efficient Programming Language 🚀</div><br />
<span class="span">Barn is a simple and efficient programming language designed for beginners and experienced programmers alike. It is compiled to C, making it fast and portable. Barn has a clean and easy-to-read syntax, making it a great choice for learning programming. It also has a growing community of users and contributors.</span>
<br /><br />
<span class="span">So, the whole Barn adventure started when I got back from school, wondering about how compilers really work. I decided to dig into the topic a bit more. After picking up some knowledge, I thought, "Why not create my own programming language that will compile to C?". <br/><br/></span><span class="span">Now, why the name Barn? No clue, but it just stuck up because how short and easy it is (Barn means Children in Swedish... So saying "I like barn" in beautiful Stockholm might be a little risky).</span>
<br/>
<br/>
<span class="span"> The first compiler of barn, was named BarnGo, it was a bit of a mess and had lots of design issues. So, I decided to ditch the GoLang version and roll up my sleeves for a fresh start in C sometimes named BarnC.
<br/>
<br/></span>

<span class="span"> And here we are, on this wild ride of Barn development. It's been a journey, fixing things, making it better. Who knew diving into compiler intricacies could lead to this? Anyway, we're making a language, having some fun, and maybe learning a thing or two along the way!</span>
</span>
<!-- <div class="buttons">
<button class="btn" >Documentation</button>
<button class="btn" >Github</button>
<button class="btn" >Author</button>
<button class="btn" >Playground</button>
<button class="btn" >Discord</button>
</div> -->
</div>
<div class="sk2">
<code>
<!-- @import "std.ba"<br/><br/>
fun main() -> i32 {<br/>
&nbsp;&nbsp;&nbsp;&nbsp;fmt_print("Hello, World!")<br/>
}<br/> -->

<span class="keywords">@import</span> <span class="strings">"std.ba"</span><br/>
<span class="keywords">@import</span> <span class="strings">"math.ba"</span><br/><br/>
<span class="keywords">@import</span> <span class="strings">"std.ba"</span><br/>
<span class="keywords">@import</span> <span class="strings">"math.ba"</span><br/><br/>

<span class="keywords">fun</span> <span class="identifier">main</span>() -> <span class="type">i32</span> {
<div class="tab">
<span class="identifier">println</span>(<span class="strings">"Enter the radius of the circle:"</span>)<br />
<span class="keywords">let</span> <span class="identifier">circle_radius</span>:
<span class="type">f32</span> = <span class="identifier">parse_float</span>(<span class="identifier">read_line_stdin</span>())</span><br />
<br /><span class="keywords">if</span> <span class="identifier">circle_radius</span><span class="math"> < 0</span> {
<span class="keywords">fun</span> <span class="identifier">main</span>() -> <span class="type">i32</span> {
<div class="tab">
<span class="identifier">println</span>(<span class="strings">"Incorrect circle radius"</span>)<br />
</div>
} <span class="keywords">else</span> {
<div class="tab">
<span class="keywords">let</span> <span class="identifier">circle_area</span>:
<span class="type">f32</span> = <span class="math">_MATH_PI * circle_radius * circle_radius </span><br />
<span class="identifier">fmt_printf</span>(<span class="strings">"Circle area = πr² = %f\n"</span>, <span class="identifier">circle_area</span>)<br />
</div>
}<br /><br />
<span class="identifier">println</span>(<span class="strings">"Enter the radius of the circle:"</span>)<br />
<span class="keywords">let</span> <span class="identifier">circle_radius</span>:
<span class="type">f32</span> = <span class="identifier">parse_float</span>(<span class="identifier">read_line_stdin</span>())</span><br />
<br /><span class="keywords">if</span> <span class="identifier">circle_radius</span><span class="math"> < 0</span> {
<div class="tab">
<span class="identifier">println</span>(<span class="strings">"Incorrect circle radius"</span>)<br />
</div>
} <span class="keywords">else</span> {
<div class="tab">
<span class="keywords">let</span> <span class="identifier">circle_area</span>:
<span class="type">f32</span> = <span class="math">_MATH_PI * circle_radius * circle_radius </span><br />
<span class="identifier">fmt_printf</span>(<span class="strings">"Circle area = πr² = %f\n"</span>, <span class="identifier">circle_area</span>)<br />
</div>
}<br /><br />

<span class="keywords">return</span> <span class="math">0</span>
</div>
}
</code>
<div class="output">
<code>
$ barn ./main.ba<br/>
$ ./b.out<br/><br/>
Enter the radius of the circle:<br/>
20<br/>
Circle area = πr² = 1256.6<br/>
<span class="keywords">return</span> <span class="math">0</span>
</div>
}
</code>
</div>

</div>
</section>
<div class="output">
<code>
$ barn ./main.ba<br/>
$ ./b.out<br/><br/>
Enter the radius of the circle:<br/>
20<br/>
Circle area = πr² = 1256.6<br/>
</code>
</div>

</div>
</section>
</div>
</body>
</html>
52 changes: 41 additions & 11 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ body {

color: white;
margin: 0;
padding: 4% 5% 4% 4%;
width: 100%;
overflow-x: hidden;
}
Expand Down Expand Up @@ -49,12 +48,12 @@ code {

.sk2 {
position:static;
font-size: 22px;
font-size: 24px;
/* border: 2px solid rgb(154, 154, 154); */
border-left: 2px solid rgb(154, 154, 154);
border-left: 2px solid #2d2d34;
/* border-radius: 24px; */
min-height: 80vh;
padding: 20px 50px;
min-height: 85vh;
padding: 20px 30px;
}

.tab {
Expand Down Expand Up @@ -87,15 +86,46 @@ code {
}

.buttons {
padding: 20px 30px;
display: flex;
justify-content: space-between;
margin-top: 30px;
padding: 30px 10px;
}

.btn {
border: none;
border-radius: 6px;
padding: 7px 20px;
background-color: gold;
padding: 5px 10px;
margin: 2px 3px;
background-color: rgb(137, 125, 216);
font-size: 18px;
cursor: pointer;
}

.btn:hover {
background-color: rgb(118, 110, 175);
}

nav img {
width: 48px;
}

nav {
padding-top: 1%;
padding-bottom: 1%;
padding-left: 3%;
padding-right: 3%;
border-bottom: 2px solid #2d2d34;
display: flex;
justify-content: space-between;
align-items: center;
}

nav div ul li {
display: inline-block;
padding: 0px 5px;
}

nav div ul li a {
color: white;
font-size: 18px;
text-decoration: none;
font-weight: 600;
}

0 comments on commit 7baf279

Please sign in to comment.